Browse Source

* FPCDIR setting/detect
* lot of other updates to create .deb files correctly

peter 25 years ago
parent
commit
c1fabab00b
61 changed files with 3128 additions and 2597 deletions
  1. 205 95
      base/Makefile
  2. 7 7
      base/Makefile.fpc
  3. 50 44
      compiler/Makefile
  4. 50 44
      compiler/new/Makefile
  5. 30 16
      ide/Makefile
  6. 30 16
      ide/fake/Makefile
  7. 38 35
      ide/fake/compiler/Makefile
  8. 38 35
      ide/fake/gdb/Makefile
  9. 107 53
      ide/text/Makefile
  10. 49 43
      install/Makefile
  11. 78 52
      install/demo/Makefile
  12. 8 4
      install/demo/Makefile.fpc
  13. 50 44
      install/fpinst/Makefile
  14. 122 269
      packages/Makefile
  15. 4 7
      packages/Makefile.fpc
  16. 67 45
      packages/forms/Makefile
  17. 84 46
      packages/forms/demo/Makefile
  18. 50 44
      packages/gdbint/Makefile
  19. 1 1
      packages/gdbint/Makefile.fpc
  20. 30 16
      packages/gdbint/libgdb/Makefile
  21. 50 44
      packages/ggi/Makefile
  22. 67 44
      packages/gtk/Makefile
  23. 17 0
      packages/gtk/Makefile.fpc
  24. 50 44
      packages/gtk/examples/Makefile
  25. 50 44
      packages/gtk/tutorial/Makefile
  26. 50 44
      packages/ibase/Makefile
  27. 50 44
      packages/inet/Makefile
  28. 50 44
      packages/mysql/Makefile
  29. 50 44
      packages/ncurses/Makefile
  30. 30 16
      packages/opengl/Makefile
  31. 70 48
      packages/opengl/build/Makefile
  32. 84 46
      packages/opengl/examples/Makefile
  33. 67 45
      packages/opengl/linux/Makefile
  34. 50 44
      packages/postgres/Makefile
  35. 50 44
      packages/svgalib/Makefile
  36. 50 44
      packages/uncgi/Makefile
  37. 50 44
      packages/utmp/Makefile
  38. 50 44
      packages/x11/Makefile
  39. 48 47
      packages/zlib/Makefile
  40. 0 3
      packages/zlib/Makefile.fpc
  41. 168 206
      packages/zlib/zlib.pp
  42. 30 16
      rtl/Makefile
  43. 51 44
      rtl/go32v1/Makefile
  44. 3 0
      rtl/go32v1/Makefile.fpc
  45. 51 44
      rtl/go32v2/Makefile
  46. 3 0
      rtl/go32v2/Makefile.fpc
  47. 51 44
      rtl/linux/Makefile
  48. 3 0
      rtl/linux/Makefile.fpc
  49. 51 44
      rtl/os2/Makefile
  50. 3 0
      rtl/os2/Makefile.fpc
  51. 51 44
      rtl/win32/Makefile
  52. 3 0
      rtl/win32/Makefile.fpc
  53. 30 16
      tests/Makefile
  54. 70 48
      utils/Makefile
  55. 193 183
      utils/fpcmake.inc
  56. 42 29
      utils/fpcmake.ini
  57. 90 51
      utils/fpcmake.pp
  58. 50 44
      utils/h2pas/Makefile
  59. 50 44
      utils/simulator/Makefile
  60. 52 45
      utils/tply/Makefile
  61. 2 2
      utils/tply/Makefile.fpc

+ 205 - 95
base/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: info
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=$(BASEDIR)
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=$(BASEDIR)
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -153,7 +180,7 @@ endif
 
 # Targets
 
-override DIROBJECTS+=$(wildcard compiler rtl utils packages ide)
+override DIROBJECTS+=$(wildcard compiler rtl utils fcl api fv packages ide)
 
 # Clean
 
@@ -167,16 +194,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -201,11 +218,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -216,12 +228,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -246,7 +252,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -273,15 +279,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 #####################################################################
@@ -621,8 +627,10 @@ endif
 OBJECTDIRCOMPILER=1
 OBJECTDIRRTL=1
 OBJECTDIRUTILS=1
-OBJECTDIRPACKAGES=1
 OBJECTDIRFCL=1
+OBJECTDIRAPI=1
+OBJECTDIRFV=1
+OBJECTDIRPACKAGES=1
 OBJECTDIRIDE=1
 
 # Dir compiler
@@ -778,57 +786,6 @@ utils_info:
 	$(MAKE) -C utils info
 endif
 
-# Dir packages
-
-ifdef OBJECTDIRPACKAGES
-.PHONY:  packages_all packages_debug packages_examples packages_test packages_smart packages_shared packages_showinstall packages_install packages_sourceinstall packages_zipinstall packages_zipinstalladd packages_clean packages_cleanall packages_require packages_info
-
-packages_all:
-	$(MAKE) -C packages all
-
-packages_debug:
-	$(MAKE) -C packages debug
-
-packages_examples:
-	$(MAKE) -C packages examples
-
-packages_test:
-	$(MAKE) -C packages test
-
-packages_smart:
-	$(MAKE) -C packages smart
-
-packages_shared:
-	$(MAKE) -C packages shared
-
-packages_showinstall:
-	$(MAKE) -C packages showinstall
-
-packages_install:
-	$(MAKE) -C packages install
-
-packages_sourceinstall:
-	$(MAKE) -C packages sourceinstall
-
-packages_zipinstall:
-	$(MAKE) -C packages zipinstall
-
-packages_zipinstalladd:
-	$(MAKE) -C packages zipinstalladd
-
-packages_clean:
-	$(MAKE) -C packages clean
-
-packages_cleanall:
-	$(MAKE) -C packages cleanall
-
-packages_require:
-	$(MAKE) -C packages require
-
-packages_info:
-	$(MAKE) -C packages info
-endif
-
 # Dir fcl
 
 ifdef OBJECTDIRFCL
@@ -880,6 +837,159 @@ fcl_info:
 	$(MAKE) -C fcl info
 endif
 
+# Dir api
+
+ifdef OBJECTDIRAPI
+.PHONY:  api_all api_debug api_examples api_test api_smart api_shared api_showinstall api_install api_sourceinstall api_zipinstall api_zipinstalladd api_clean api_cleanall api_require api_info
+
+api_all:
+	$(MAKE) -C api all
+
+api_debug:
+	$(MAKE) -C api debug
+
+api_examples:
+	$(MAKE) -C api examples
+
+api_test:
+	$(MAKE) -C api test
+
+api_smart:
+	$(MAKE) -C api smart
+
+api_shared:
+	$(MAKE) -C api shared
+
+api_showinstall:
+	$(MAKE) -C api showinstall
+
+api_install:
+	$(MAKE) -C api install
+
+api_sourceinstall:
+	$(MAKE) -C api sourceinstall
+
+api_zipinstall:
+	$(MAKE) -C api zipinstall
+
+api_zipinstalladd:
+	$(MAKE) -C api zipinstalladd
+
+api_clean:
+	$(MAKE) -C api clean
+
+api_cleanall:
+	$(MAKE) -C api cleanall
+
+api_require:
+	$(MAKE) -C api require
+
+api_info:
+	$(MAKE) -C api info
+endif
+
+# Dir fv
+
+ifdef OBJECTDIRFV
+.PHONY:  fv_all fv_debug fv_examples fv_test fv_smart fv_shared fv_showinstall fv_install fv_sourceinstall fv_zipinstall fv_zipinstalladd fv_clean fv_cleanall fv_require fv_info
+
+fv_all:
+	$(MAKE) -C fv all
+
+fv_debug:
+	$(MAKE) -C fv debug
+
+fv_examples:
+	$(MAKE) -C fv examples
+
+fv_test:
+	$(MAKE) -C fv test
+
+fv_smart:
+	$(MAKE) -C fv smart
+
+fv_shared:
+	$(MAKE) -C fv shared
+
+fv_showinstall:
+	$(MAKE) -C fv showinstall
+
+fv_install:
+	$(MAKE) -C fv install
+
+fv_sourceinstall:
+	$(MAKE) -C fv sourceinstall
+
+fv_zipinstall:
+	$(MAKE) -C fv zipinstall
+
+fv_zipinstalladd:
+	$(MAKE) -C fv zipinstalladd
+
+fv_clean:
+	$(MAKE) -C fv clean
+
+fv_cleanall:
+	$(MAKE) -C fv cleanall
+
+fv_require:
+	$(MAKE) -C fv require
+
+fv_info:
+	$(MAKE) -C fv info
+endif
+
+# Dir packages
+
+ifdef OBJECTDIRPACKAGES
+.PHONY:  packages_all packages_debug packages_examples packages_test packages_smart packages_shared packages_showinstall packages_install packages_sourceinstall packages_zipinstall packages_zipinstalladd packages_clean packages_cleanall packages_require packages_info
+
+packages_all:
+	$(MAKE) -C packages all
+
+packages_debug:
+	$(MAKE) -C packages debug
+
+packages_examples:
+	$(MAKE) -C packages examples
+
+packages_test:
+	$(MAKE) -C packages test
+
+packages_smart:
+	$(MAKE) -C packages smart
+
+packages_shared:
+	$(MAKE) -C packages shared
+
+packages_showinstall:
+	$(MAKE) -C packages showinstall
+
+packages_install:
+	$(MAKE) -C packages install
+
+packages_sourceinstall:
+	$(MAKE) -C packages sourceinstall
+
+packages_zipinstall:
+	$(MAKE) -C packages zipinstall
+
+packages_zipinstalladd:
+	$(MAKE) -C packages zipinstalladd
+
+packages_clean:
+	$(MAKE) -C packages clean
+
+packages_cleanall:
+	$(MAKE) -C packages cleanall
+
+packages_require:
+	$(MAKE) -C packages require
+
+packages_info:
+	$(MAKE) -C packages info
+endif
+
 # Dir ide
 
 ifdef OBJECTDIRIDE
@@ -985,7 +1095,7 @@ ide_fullgdb:
 #######################################
 
 demo_install:
-	$(MAKE) -C demo installdemo
+	$(MAKE) -C demo installexamples
 
 man_install:
 	$(MAKE) -C man installman
@@ -1018,11 +1128,11 @@ ide_fullgdbzip:
 	$(MAKE) -C ide/text zipinstall ZIPNAME=ide-full-$(PACKAGESUFFIX)
 
 fvzip: rtl_clean
-	$(MAKE) -C packages api_clean
-	$(MAKE) -C packages fv_clean
-	$(MAKE) -C packages fv_all
-	$(MAKE) -C packages api_zipinstall ZIPNAME=fv-$(PACKAGESUFFIX)
-	$(MAKE) -C packages fv_zipinstalladd ZIPNAME=fv-$(PACKAGESUFFIX)
+	$(MAKE) api_clean
+	$(MAKE) fv_clean
+	$(MAKE) fv_all
+	$(MAKE) api_zipinstall ZIPNAME=fv-$(PACKAGESUFFIX)
+	$(MAKE) fv_zipinstalladd ZIPNAME=fv-$(PACKAGESUFFIX)
 
 gtkzip: rtl_clean
 	$(MAKE) -C packages gtk_clean

+ 7 - 7
base/Makefile.fpc

@@ -3,7 +3,7 @@
 #
 
 [targets]
-dirs=compiler rtl utils packages ide
+dirs=compiler rtl utils fcl api fv packages ide
 
 [defaults]
 defaultrule=info
@@ -72,7 +72,7 @@ ide_fullgdb:
 #######################################
 
 demo_install:
-        $(MAKE) -C demo installdemo
+        $(MAKE) -C demo installexamples
 
 man_install:
         $(MAKE) -C man installman
@@ -105,11 +105,11 @@ ide_fullgdbzip:
         $(MAKE) -C ide/text zipinstall ZIPNAME=ide-full-$(PACKAGESUFFIX)
 
 fvzip: rtl_clean
-        $(MAKE) -C packages api_clean
-        $(MAKE) -C packages fv_clean
-        $(MAKE) -C packages fv_all
-        $(MAKE) -C packages api_zipinstall ZIPNAME=fv-$(PACKAGESUFFIX)
-        $(MAKE) -C packages fv_zipinstalladd ZIPNAME=fv-$(PACKAGESUFFIX)
+        $(MAKE) api_clean
+        $(MAKE) fv_clean
+        $(MAKE) fv_all
+        $(MAKE) api_zipinstall ZIPNAME=fv-$(PACKAGESUFFIX)
+        $(MAKE) fv_zipinstalladd ZIPNAME=fv-$(PACKAGESUFFIX)
 
 gtkzip: rtl_clean
         $(MAKE) -C packages gtk_clean

+ 50 - 44
compiler/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -215,16 +242,6 @@ override NEEDOPT=-Sg
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 ifndef TARGETDIR
 TARGETDIR=.
 endif
@@ -274,11 +291,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -289,12 +301,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -319,7 +325,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -346,15 +352,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -374,14 +380,14 @@ ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Target dirs
 ifdef TARGETDIR
 override FPCOPT+=-FE$(TARGETDIR)
@@ -894,7 +900,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -919,8 +925,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1087,7 +1093,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 50 - 44
compiler/new/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -230,16 +257,6 @@ override NEEDOPT=-Sg
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDUNITDIR=$(CPU_TARGET) . $(OLDDIR)
 override NEEDINCDIR=$(OLDDIR)
 ifndef TARGETDIR
@@ -291,11 +308,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -306,12 +318,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -336,7 +342,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -363,15 +369,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -391,14 +397,14 @@ ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -920,7 +926,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -945,8 +951,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1113,7 +1119,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 30 - 16
ide/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -108,18 +108,42 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -162,16 +186,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 

+ 30 - 16
ide/fake/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -108,18 +108,42 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -162,16 +186,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 

+ 38 - 35
ide/fake/compiler/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -108,18 +108,42 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -162,16 +186,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -196,11 +210,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -211,12 +220,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -241,7 +244,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -268,15 +271,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -797,7 +800,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -822,8 +825,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -990,6 +993,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 38 - 35
ide/fake/gdb/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -108,18 +108,42 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -162,16 +186,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -196,11 +210,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -211,12 +220,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -241,7 +244,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -268,15 +271,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -797,7 +800,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -822,8 +825,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -990,7 +993,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 107 - 53
ide/text/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -195,16 +222,6 @@ override NEEDOPT=-Sg
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDUNITDIR=$(COMPUNITDIR) $(GDBUNITDIR)
 override NEEDLIBDIR=$(GDBLIBDIR)
 override NEEDOBJDIR=$(GDBOBJDIR)
@@ -214,24 +231,72 @@ override NEEDOBJDIR=$(GDBOBJDIR)
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 override PACKAGES+=api fv gdbint
-ifneq ($(wildcard $(PACKAGEDIR)/api/$(OS_TARGET)),)
-PACKAGEDIR_API=$(PACKAGEDIR)/api/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/api),)
+ifneq ($(wildcard $(FPCDIR)/api/$(OS_TARGET)),)
+PACKAGEDIR_API=$(FPCDIR)/api/$(OS_TARGET)
+else
+PACKAGEDIR_API=$(FPCDIR)/api
+endif
+UNITDIR_API=$(PACKAGEDIR_API)
 else
-PACKAGEDIR_API=$(PACKAGEDIR)/api
+PACKAGEDIR_API=
+ifneq ($(wildcard $(UNITSDIR)/api),)
+ifneq ($(wildcard $(UNITSDIR)/api/$(OS_TARGET)),)
+UNITDIR_API=$(UNITSDIR)/api/$(OS_TARGET)
+else
+UNITDIR_API=$(UNITSDIR)/api
+endif
+else
+UNITDIR_API=
+endif
+endif
+ifdef UNITDIR_API
+override NEEDUNITDIR+=$(UNITDIR_API)
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_API)
-ifneq ($(wildcard $(PACKAGEDIR)/fv/$(OS_TARGET)),)
-PACKAGEDIR_FV=$(PACKAGEDIR)/fv/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/fv),)
+ifneq ($(wildcard $(FPCDIR)/fv/$(OS_TARGET)),)
+PACKAGEDIR_FV=$(FPCDIR)/fv/$(OS_TARGET)
 else
-PACKAGEDIR_FV=$(PACKAGEDIR)/fv
+PACKAGEDIR_FV=$(FPCDIR)/fv
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_FV)
+UNITDIR_FV=$(PACKAGEDIR_FV)
+else
+PACKAGEDIR_FV=
+ifneq ($(wildcard $(UNITSDIR)/fv),)
+ifneq ($(wildcard $(UNITSDIR)/fv/$(OS_TARGET)),)
+UNITDIR_FV=$(UNITSDIR)/fv/$(OS_TARGET)
+else
+UNITDIR_FV=$(UNITSDIR)/fv
+endif
+else
+UNITDIR_FV=
+endif
+endif
+ifdef UNITDIR_FV
+override NEEDUNITDIR+=$(UNITDIR_FV)
+endif
+ifneq ($(wildcard $(PACKAGEDIR)/gdbint),)
 ifneq ($(wildcard $(PACKAGEDIR)/gdbint/$(OS_TARGET)),)
 PACKAGEDIR_GDBINT=$(PACKAGEDIR)/gdbint/$(OS_TARGET)
 else
 PACKAGEDIR_GDBINT=$(PACKAGEDIR)/gdbint
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_GDBINT)
+UNITDIR_GDBINT=$(PACKAGEDIR_GDBINT)
+else
+PACKAGEDIR_GDBINT=
+ifneq ($(wildcard $(UNITSDIR)/gdbint),)
+ifneq ($(wildcard $(UNITSDIR)/gdbint/$(OS_TARGET)),)
+UNITDIR_GDBINT=$(UNITSDIR)/gdbint/$(OS_TARGET)
+else
+UNITDIR_GDBINT=$(UNITSDIR)/gdbint
+endif
+else
+UNITDIR_GDBINT=
+endif
+endif
+ifdef UNITDIR_GDBINT
+override NEEDUNITDIR+=$(UNITDIR_GDBINT)
+endif
 
 # Libraries
 
@@ -258,11 +323,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -273,12 +333,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
 ifndef GCCLIBDIR
@@ -311,7 +365,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -338,15 +392,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -366,14 +420,14 @@ ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -924,7 +978,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -949,8 +1003,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1117,7 +1171,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 49 - 43
install/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: help
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -194,16 +221,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -224,11 +241,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -239,12 +251,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -269,7 +275,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -296,15 +302,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -320,14 +326,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -817,7 +823,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -842,8 +848,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################

+ 78 - 52
install/demo/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: both
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -177,16 +204,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDUNITDIR=$(FPCDIR)/api
 ifndef TARGETDIR
 TARGETDIR=.
@@ -197,12 +214,28 @@ endif
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 override PACKAGES+=api
-ifneq ($(wildcard $(PACKAGEDIR)/api/$(OS_TARGET)),)
-PACKAGEDIR_API=$(PACKAGEDIR)/api/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/api),)
+ifneq ($(wildcard $(FPCDIR)/api/$(OS_TARGET)),)
+PACKAGEDIR_API=$(FPCDIR)/api/$(OS_TARGET)
+else
+PACKAGEDIR_API=$(FPCDIR)/api
+endif
+UNITDIR_API=$(PACKAGEDIR_API)
+else
+PACKAGEDIR_API=
+ifneq ($(wildcard $(UNITSDIR)/api),)
+ifneq ($(wildcard $(UNITSDIR)/api/$(OS_TARGET)),)
+UNITDIR_API=$(UNITSDIR)/api/$(OS_TARGET)
 else
-PACKAGEDIR_API=$(PACKAGEDIR)/api
+UNITDIR_API=$(UNITSDIR)/api
+endif
+else
+UNITDIR_API=
+endif
+endif
+ifdef UNITDIR_API
+override NEEDUNITDIR+=$(UNITDIR_API)
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_API)
 
 # Libraries
 
@@ -228,11 +261,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -243,12 +271,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -273,7 +295,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -300,15 +322,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -324,14 +346,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -870,7 +892,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -895,8 +917,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1063,7 +1085,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################
@@ -1097,8 +1119,12 @@ both:
 # Demo installation for linux
 #
 
-DEMOINSTALLDIR=$(DOCINSTALLDIR)/demo
+.PHONY: installexamples
+
+ifndef EXAMPLESINSTALLDIR
+EXAMPLESINSTALLDIR=$(DOCINSTALLDIR)/examples
+endif
 
-installdemo:
-	$(MKDIR) $(DEMOINSTALLDIR)
-	$(COPY) -rf * $(DEMOINSTALLDIR)
+installexamples:
+	$(MKDIR) $(EXAMPLESINSTALLDIR)
+	$(COPYTREE) * $(EXAMPLESINSTALLDIR)

+ 8 - 4
install/demo/Makefile.fpc

@@ -54,8 +54,12 @@ both:
 # Demo installation for linux
 #
 
-DEMOINSTALLDIR=$(DOCINSTALLDIR)/demo
+.PHONY: installexamples
 
-installdemo:
-        $(MKDIR) $(DEMOINSTALLDIR)
-        $(COPY) -rf * $(DEMOINSTALLDIR)
+ifndef EXAMPLESINSTALLDIR
+EXAMPLESINSTALLDIR=$(DOCINSTALLDIR)/examples
+endif
+
+installexamples:
+        $(MKDIR) $(EXAMPLESINSTALLDIR)
+        $(COPYTREE) * $(EXAMPLESINSTALLDIR)

+ 50 - 44
install/fpinst/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -171,16 +198,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 ifndef TARGETDIR
 TARGETDIR=.
 endif
@@ -208,11 +225,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -223,12 +235,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -253,7 +259,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -280,15 +286,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -304,14 +310,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Target dirs
 ifdef TARGETDIR
 override FPCOPT+=-FE$(TARGETDIR)
@@ -823,7 +829,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -848,8 +854,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1016,6 +1022,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 122 - 269
packages/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -108,18 +108,42 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -148,18 +172,15 @@ endif
 
 # Targets
 
-override DIROBJECTS+=$(wildcard fcl ibase mysql uncgi gdbint api fv)
+override DIROBJECTS+=$(wildcard ibase mysql uncgi paszlib)
 ifeq ($(OS_TARGET),linux)
-override DIROBJECTS+=$(wildcard gtk opengl utmp inet postgres ncurses x11 forms svgalib ggi zlib)
+override DIROBJECTS+=$(wildcard gtk opengl gdbint utmp inet postgres ncurses x11 forms svgalib ggi zlib)
 endif
 ifeq ($(OS_TARGET),go32v2)
-override DIROBJECTS+=$(wildcard paszlib)
+override DIROBJECTS+=$(wildcard gdbint)
 endif
 ifeq ($(OS_TARGET),win32)
-override DIROBJECTS+=$(wildcard gtk opengl paszlib)
-endif
-ifeq ($(OS_TARGET),os2)
-override DIROBJECTS+=$(wildcard paszlib)
+override DIROBJECTS+=$(wildcard gtk opengl gdbint)
 endif
 
 # Clean
@@ -174,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -239,16 +250,14 @@ endif
 
 # Target Dirs
 
-OBJECTDIRFCL=1
 OBJECTDIRIBASE=1
 OBJECTDIRMYSQL=1
 OBJECTDIRUNCGI=1
-OBJECTDIRGDBINT=1
-OBJECTDIRAPI=1
-OBJECTDIRFV=1
+OBJECTDIRPASZLIB=1
 ifeq ($(OS_TARGET),linux)
 OBJECTDIRGTK=1
 OBJECTDIROPENGL=1
+OBJECTDIRGDBINT=1
 OBJECTDIRUTMP=1
 OBJECTDIRINET=1
 OBJECTDIRPOSTGRES=1
@@ -260,66 +269,12 @@ OBJECTDIRGGI=1
 OBJECTDIRZLIB=1
 endif
 ifeq ($(OS_TARGET),go32v2)
-OBJECTDIRPASZLIB=1
+OBJECTDIRGDBINT=1
 endif
 ifeq ($(OS_TARGET),win32)
 OBJECTDIRGTK=1
 OBJECTDIROPENGL=1
-OBJECTDIRPASZLIB=1
-endif
-ifeq ($(OS_TARGET),os2)
-OBJECTDIRPASZLIB=1
-endif
-
-# Dir fcl
-
-ifdef OBJECTDIRFCL
-.PHONY:  fcl_all fcl_debug fcl_examples fcl_test fcl_smart fcl_shared fcl_showinstall fcl_install fcl_sourceinstall fcl_zipinstall fcl_zipinstalladd fcl_clean fcl_cleanall fcl_require fcl_info
-
-fcl_all:
-	$(MAKE) -C fcl all
-
-fcl_debug:
-	$(MAKE) -C fcl debug
-
-fcl_examples:
-	$(MAKE) -C fcl examples
-
-fcl_test:
-	$(MAKE) -C fcl test
-
-fcl_smart:
-	$(MAKE) -C fcl smart
-
-fcl_shared:
-	$(MAKE) -C fcl shared
-
-fcl_showinstall:
-	$(MAKE) -C fcl showinstall
-
-fcl_install:
-	$(MAKE) -C fcl install
-
-fcl_sourceinstall:
-	$(MAKE) -C fcl sourceinstall
-
-fcl_zipinstall:
-	$(MAKE) -C fcl zipinstall
-
-fcl_zipinstalladd:
-	$(MAKE) -C fcl zipinstalladd
-
-fcl_clean:
-	$(MAKE) -C fcl clean
-
-fcl_cleanall:
-	$(MAKE) -C fcl cleanall
-
-fcl_require:
-	$(MAKE) -C fcl require
-
-fcl_info:
-	$(MAKE) -C fcl info
+OBJECTDIRGDBINT=1
 endif
 
 # Dir ibase
@@ -475,157 +430,55 @@ uncgi_info:
 	$(MAKE) -C uncgi info
 endif
 
-# Dir gdbint
-
-ifdef OBJECTDIRGDBINT
-.PHONY:  gdbint_all gdbint_debug gdbint_examples gdbint_test gdbint_smart gdbint_shared gdbint_showinstall gdbint_install gdbint_sourceinstall gdbint_zipinstall gdbint_zipinstalladd gdbint_clean gdbint_cleanall gdbint_require gdbint_info
-
-gdbint_all:
-	$(MAKE) -C gdbint all
-
-gdbint_debug:
-	$(MAKE) -C gdbint debug
-
-gdbint_examples:
-	$(MAKE) -C gdbint examples
-
-gdbint_test:
-	$(MAKE) -C gdbint test
-
-gdbint_smart:
-	$(MAKE) -C gdbint smart
-
-gdbint_shared:
-	$(MAKE) -C gdbint shared
-
-gdbint_showinstall:
-	$(MAKE) -C gdbint showinstall
-
-gdbint_install:
-	$(MAKE) -C gdbint install
-
-gdbint_sourceinstall:
-	$(MAKE) -C gdbint sourceinstall
-
-gdbint_zipinstall:
-	$(MAKE) -C gdbint zipinstall
-
-gdbint_zipinstalladd:
-	$(MAKE) -C gdbint zipinstalladd
-
-gdbint_clean:
-	$(MAKE) -C gdbint clean
-
-gdbint_cleanall:
-	$(MAKE) -C gdbint cleanall
-
-gdbint_require:
-	$(MAKE) -C gdbint require
-
-gdbint_info:
-	$(MAKE) -C gdbint info
-endif
-
-# Dir api
-
-ifdef OBJECTDIRAPI
-.PHONY:  api_all api_debug api_examples api_test api_smart api_shared api_showinstall api_install api_sourceinstall api_zipinstall api_zipinstalladd api_clean api_cleanall api_require api_info
-
-api_all:
-	$(MAKE) -C api all
-
-api_debug:
-	$(MAKE) -C api debug
-
-api_examples:
-	$(MAKE) -C api examples
-
-api_test:
-	$(MAKE) -C api test
-
-api_smart:
-	$(MAKE) -C api smart
-
-api_shared:
-	$(MAKE) -C api shared
-
-api_showinstall:
-	$(MAKE) -C api showinstall
-
-api_install:
-	$(MAKE) -C api install
-
-api_sourceinstall:
-	$(MAKE) -C api sourceinstall
-
-api_zipinstall:
-	$(MAKE) -C api zipinstall
-
-api_zipinstalladd:
-	$(MAKE) -C api zipinstalladd
-
-api_clean:
-	$(MAKE) -C api clean
-
-api_cleanall:
-	$(MAKE) -C api cleanall
-
-api_require:
-	$(MAKE) -C api require
-
-api_info:
-	$(MAKE) -C api info
-endif
-
-# Dir fv
+# Dir paszlib
 
-ifdef OBJECTDIRFV
-.PHONY:  fv_all fv_debug fv_examples fv_test fv_smart fv_shared fv_showinstall fv_install fv_sourceinstall fv_zipinstall fv_zipinstalladd fv_clean fv_cleanall fv_require fv_info
+ifdef OBJECTDIRPASZLIB
+.PHONY:  paszlib_all paszlib_debug paszlib_examples paszlib_test paszlib_smart paszlib_shared paszlib_showinstall paszlib_install paszlib_sourceinstall paszlib_zipinstall paszlib_zipinstalladd paszlib_clean paszlib_cleanall paszlib_require paszlib_info
 
-fv_all:
-	$(MAKE) -C fv all
+paszlib_all:
+	$(MAKE) -C paszlib all
 
-fv_debug:
-	$(MAKE) -C fv debug
+paszlib_debug:
+	$(MAKE) -C paszlib debug
 
-fv_examples:
-	$(MAKE) -C fv examples
+paszlib_examples:
+	$(MAKE) -C paszlib examples
 
-fv_test:
-	$(MAKE) -C fv test
+paszlib_test:
+	$(MAKE) -C paszlib test
 
-fv_smart:
-	$(MAKE) -C fv smart
+paszlib_smart:
+	$(MAKE) -C paszlib smart
 
-fv_shared:
-	$(MAKE) -C fv shared
+paszlib_shared:
+	$(MAKE) -C paszlib shared
 
-fv_showinstall:
-	$(MAKE) -C fv showinstall
+paszlib_showinstall:
+	$(MAKE) -C paszlib showinstall
 
-fv_install:
-	$(MAKE) -C fv install
+paszlib_install:
+	$(MAKE) -C paszlib install
 
-fv_sourceinstall:
-	$(MAKE) -C fv sourceinstall
+paszlib_sourceinstall:
+	$(MAKE) -C paszlib sourceinstall
 
-fv_zipinstall:
-	$(MAKE) -C fv zipinstall
+paszlib_zipinstall:
+	$(MAKE) -C paszlib zipinstall
 
-fv_zipinstalladd:
-	$(MAKE) -C fv zipinstalladd
+paszlib_zipinstalladd:
+	$(MAKE) -C paszlib zipinstalladd
 
-fv_clean:
-	$(MAKE) -C fv clean
+paszlib_clean:
+	$(MAKE) -C paszlib clean
 
-fv_cleanall:
-	$(MAKE) -C fv cleanall
+paszlib_cleanall:
+	$(MAKE) -C paszlib cleanall
 
-fv_require:
-	$(MAKE) -C fv require
+paszlib_require:
+	$(MAKE) -C paszlib require
 
-fv_info:
-	$(MAKE) -C fv info
+paszlib_info:
+	$(MAKE) -C paszlib info
 endif
 
 # Dir gtk
@@ -730,6 +583,57 @@ opengl_info:
 	$(MAKE) -C opengl info
 endif
 
+# Dir gdbint
+
+ifdef OBJECTDIRGDBINT
+.PHONY:  gdbint_all gdbint_debug gdbint_examples gdbint_test gdbint_smart gdbint_shared gdbint_showinstall gdbint_install gdbint_sourceinstall gdbint_zipinstall gdbint_zipinstalladd gdbint_clean gdbint_cleanall gdbint_require gdbint_info
+
+gdbint_all:
+	$(MAKE) -C gdbint all
+
+gdbint_debug:
+	$(MAKE) -C gdbint debug
+
+gdbint_examples:
+	$(MAKE) -C gdbint examples
+
+gdbint_test:
+	$(MAKE) -C gdbint test
+
+gdbint_smart:
+	$(MAKE) -C gdbint smart
+
+gdbint_shared:
+	$(MAKE) -C gdbint shared
+
+gdbint_showinstall:
+	$(MAKE) -C gdbint showinstall
+
+gdbint_install:
+	$(MAKE) -C gdbint install
+
+gdbint_sourceinstall:
+	$(MAKE) -C gdbint sourceinstall
+
+gdbint_zipinstall:
+	$(MAKE) -C gdbint zipinstall
+
+gdbint_zipinstalladd:
+	$(MAKE) -C gdbint zipinstalladd
+
+gdbint_clean:
+	$(MAKE) -C gdbint clean
+
+gdbint_cleanall:
+	$(MAKE) -C gdbint cleanall
+
+gdbint_require:
+	$(MAKE) -C gdbint require
+
+gdbint_info:
+	$(MAKE) -C gdbint info
+endif
+
 # Dir utmp
 
 ifdef OBJECTDIRUTMP
@@ -1189,54 +1093,3 @@ zlib_info:
 	$(MAKE) -C zlib info
 endif
 
-# Dir paszlib
-
-ifdef OBJECTDIRPASZLIB
-.PHONY:  paszlib_all paszlib_debug paszlib_examples paszlib_test paszlib_smart paszlib_shared paszlib_showinstall paszlib_install paszlib_sourceinstall paszlib_zipinstall paszlib_zipinstalladd paszlib_clean paszlib_cleanall paszlib_require paszlib_info
-
-paszlib_all:
-	$(MAKE) -C paszlib all
-
-paszlib_debug:
-	$(MAKE) -C paszlib debug
-
-paszlib_examples:
-	$(MAKE) -C paszlib examples
-
-paszlib_test:
-	$(MAKE) -C paszlib test
-
-paszlib_smart:
-	$(MAKE) -C paszlib smart
-
-paszlib_shared:
-	$(MAKE) -C paszlib shared
-
-paszlib_showinstall:
-	$(MAKE) -C paszlib showinstall
-
-paszlib_install:
-	$(MAKE) -C paszlib install
-
-paszlib_sourceinstall:
-	$(MAKE) -C paszlib sourceinstall
-
-paszlib_zipinstall:
-	$(MAKE) -C paszlib zipinstall
-
-paszlib_zipinstalladd:
-	$(MAKE) -C paszlib zipinstalladd
-
-paszlib_clean:
-	$(MAKE) -C paszlib clean
-
-paszlib_cleanall:
-	$(MAKE) -C paszlib cleanall
-
-paszlib_require:
-	$(MAKE) -C paszlib require
-
-paszlib_info:
-	$(MAKE) -C paszlib info
-endif
-

+ 4 - 7
packages/Makefile.fpc

@@ -3,13 +3,10 @@
 #
 
 [targets]
-# For linux zlib is used for others paszlib is used, can't include both
-# because of conflicting units
-dirs=fcl ibase mysql uncgi gdbint api fv
-dirs_linux=gtk opengl utmp inet postgres ncurses x11 forms svgalib ggi zlib
-dirs_win32=gtk opengl paszlib
-dirs_go32v2=paszlib
-dirs_os2=paszlib
+dirs=ibase mysql uncgi paszlib
+dirs_linux=gtk opengl gdbint utmp inet postgres ncurses x11 forms svgalib ggi zlib
+dirs_win32=gtk opengl gdbint
+dirs_go32v2=gdbint
 
 [sections]
 none=1

+ 67 - 45
packages/forms/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,28 +195,34 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 override PACKAGES+=x11
+ifneq ($(wildcard $(PACKAGEDIR)/x11),)
 ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
 PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
 else
 PACKAGEDIR_X11=$(PACKAGEDIR)/x11
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_X11)
+UNITDIR_X11=$(PACKAGEDIR_X11)
+else
+PACKAGEDIR_X11=
+ifneq ($(wildcard $(UNITSDIR)/x11),)
+ifneq ($(wildcard $(UNITSDIR)/x11/$(OS_TARGET)),)
+UNITDIR_X11=$(UNITSDIR)/x11/$(OS_TARGET)
+else
+UNITDIR_X11=$(UNITSDIR)/x11
+endif
+else
+UNITDIR_X11=
+endif
+endif
+ifdef UNITDIR_X11
+override NEEDUNITDIR+=$(UNITDIR_X11)
+endif
 
 # Libraries
 
@@ -209,11 +242,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -224,12 +252,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -254,7 +276,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -281,15 +303,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -305,14 +327,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -848,7 +870,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -873,8 +895,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1041,7 +1063,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 84 - 46
packages/forms/demo/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -167,34 +194,56 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 override PACKAGES+=forms x11
+ifneq ($(wildcard $(PACKAGEDIR)/forms),)
 ifneq ($(wildcard $(PACKAGEDIR)/forms/$(OS_TARGET)),)
 PACKAGEDIR_FORMS=$(PACKAGEDIR)/forms/$(OS_TARGET)
 else
 PACKAGEDIR_FORMS=$(PACKAGEDIR)/forms
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_FORMS)
+UNITDIR_FORMS=$(PACKAGEDIR_FORMS)
+else
+PACKAGEDIR_FORMS=
+ifneq ($(wildcard $(UNITSDIR)/forms),)
+ifneq ($(wildcard $(UNITSDIR)/forms/$(OS_TARGET)),)
+UNITDIR_FORMS=$(UNITSDIR)/forms/$(OS_TARGET)
+else
+UNITDIR_FORMS=$(UNITSDIR)/forms
+endif
+else
+UNITDIR_FORMS=
+endif
+endif
+ifdef UNITDIR_FORMS
+override NEEDUNITDIR+=$(UNITDIR_FORMS)
+endif
+ifneq ($(wildcard $(PACKAGEDIR)/x11),)
 ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
 PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
 else
 PACKAGEDIR_X11=$(PACKAGEDIR)/x11
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_X11)
+UNITDIR_X11=$(PACKAGEDIR_X11)
+else
+PACKAGEDIR_X11=
+ifneq ($(wildcard $(UNITSDIR)/x11),)
+ifneq ($(wildcard $(UNITSDIR)/x11/$(OS_TARGET)),)
+UNITDIR_X11=$(UNITSDIR)/x11/$(OS_TARGET)
+else
+UNITDIR_X11=$(UNITSDIR)/x11
+endif
+else
+UNITDIR_X11=
+endif
+endif
+ifdef UNITDIR_X11
+override NEEDUNITDIR+=$(UNITDIR_X11)
+endif
 
 # Libraries
 
@@ -215,11 +264,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -230,12 +274,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 # Where to find other libraries
 ifdef inlinux
 ifndef OTHERLIBDIR
@@ -268,7 +306,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -295,15 +333,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -319,14 +357,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -863,7 +901,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -888,8 +926,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1056,6 +1094,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 50 - 44
packages/gdbint/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDLIBDIR=libgdb/$(OS_TARGET)
 override NEEDOBJDIR=libgdb/$(OS_TARGET)
 ifndef TARGETDIR
@@ -208,11 +225,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -223,12 +235,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
 ifndef GCCLIBDIR
@@ -261,7 +267,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -288,15 +294,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -312,14 +318,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(NEEDLIBDIR))
 endif
@@ -860,7 +866,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -885,8 +891,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1053,7 +1059,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 1 - 1
packages/gdbint/Makefile.fpc

@@ -7,7 +7,7 @@ units=gdbint gdbcon
 examples=testgdb symify
 
 [dirs]
-fpcdir=..
+fpcdir=../..
 targetdir=.
 objdir=libgdb/$(OS_TARGET)
 libdir=libgdb/$(OS_TARGET)

+ 30 - 16
packages/gdbint/libgdb/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -108,18 +108,42 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -161,16 +185,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 

+ 50 - 44
packages/ggi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -830,7 +836,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -855,8 +861,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1023,6 +1029,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 67 - 44
packages/gtk/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 # Directories
 
 vpath %$(PASEXT) glib gdk gtk
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 ifndef TARGETDIR
 TARGETDIR=.
 endif
@@ -206,11 +223,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -221,12 +233,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -251,7 +257,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -278,15 +284,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -302,14 +308,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Target dirs
 ifdef TARGETDIR
 override FPCOPT+=-FE$(TARGETDIR)
@@ -818,7 +824,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -843,8 +849,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1011,7 +1017,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################
@@ -1030,9 +1036,26 @@ gdk$(PPUEXT): $(wildcard gdk/gdk*$(PASEXT)) glib$(PPUEXT)
 
 gtk$(PPUEXT): $(wildcard gtk/gtk*$(PASEXT)) gdk$(PPUEXT)
 
+
 # Examples, tutorial
+
+.PHONY: examples tutorial installexamples
+
 examples: all
 	$(MAKE) -C examples
 
 tutorial: all
 	$(MAKE) -C tutorial
+
+ifndef EXAMPLESINSTALLDIR
+EXAMPLESINSTALLDIR=$(DOCINSTALLDIR)/examples
+endif
+ifndef TUTORIALINSTALLDIR
+TUTORIALINSTALLDIR=$(DOCINSTALLDIR)/tutorial
+endif
+
+installexamples:
+	$(MKDIR) $(EXAMPLESINSTALLDIR)
+	$(COPYTREE) examples/* $(EXAMPLESINSTALLDIR)
+	$(MKDIR) $(TUTORIALINSTALLDIR)
+	$(COPYTREE) tutorial/* $(TUTORIALINSTALLDIR)

+ 17 - 0
packages/gtk/Makefile.fpc

@@ -27,9 +27,26 @@ gdk$(PPUEXT): $(wildcard gdk/gdk*$(PASEXT)) glib$(PPUEXT)
 
 gtk$(PPUEXT): $(wildcard gtk/gtk*$(PASEXT)) gdk$(PPUEXT)
 
+
 # Examples, tutorial
+
+.PHONY: examples tutorial installexamples
+
 examples: all
         $(MAKE) -C examples
 
 tutorial: all
         $(MAKE) -C tutorial
+
+ifndef EXAMPLESINSTALLDIR
+EXAMPLESINSTALLDIR=$(DOCINSTALLDIR)/examples
+endif
+ifndef TUTORIALINSTALLDIR
+TUTORIALINSTALLDIR=$(DOCINSTALLDIR)/tutorial
+endif
+
+installexamples:
+        $(MKDIR) $(EXAMPLESINSTALLDIR)
+        $(COPYTREE) examples/* $(EXAMPLESINSTALLDIR)
+        $(MKDIR) $(TUTORIALINSTALLDIR)
+        $(COPYTREE) tutorial/* $(TUTORIALINSTALLDIR)

+ 50 - 44
packages/gtk/examples/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDUNITDIR=..
 ifndef TARGETDIR
 TARGETDIR=.
@@ -208,11 +225,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -223,12 +235,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
 ifndef GCCLIBDIR
@@ -269,7 +275,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -296,15 +302,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -320,14 +326,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -853,7 +859,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -878,8 +884,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1046,6 +1052,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 50 - 44
packages/gtk/tutorial/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -167,16 +194,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDUNITDIR=..
 ifndef TARGETDIR
 TARGETDIR=.
@@ -207,11 +224,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -222,12 +234,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
 ifndef GCCLIBDIR
@@ -268,7 +274,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -295,15 +301,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -319,14 +325,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -852,7 +858,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -877,8 +883,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1045,6 +1051,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 50 - 44
packages/ibase/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -830,7 +836,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -855,8 +861,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1023,7 +1029,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 50 - 44
packages/inet/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -830,7 +836,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -855,8 +861,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1023,7 +1029,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 50 - 44
packages/mysql/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -830,7 +836,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -855,8 +861,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1023,7 +1029,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 50 - 44
packages/ncurses/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -830,7 +836,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -855,8 +861,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1023,7 +1029,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 30 - 16
packages/opengl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -108,18 +108,42 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -162,16 +186,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 

+ 70 - 48
packages/opengl/build/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,28 +195,34 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 override PACKAGES+=fcl
-ifneq ($(wildcard $(PACKAGEDIR)/fcl/$(OS_TARGET)),)
-PACKAGEDIR_FCL=$(PACKAGEDIR)/fcl/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/fcl),)
+ifneq ($(wildcard $(FPCDIR)/fcl/$(OS_TARGET)),)
+PACKAGEDIR_FCL=$(FPCDIR)/fcl/$(OS_TARGET)
+else
+PACKAGEDIR_FCL=$(FPCDIR)/fcl
+endif
+UNITDIR_FCL=$(PACKAGEDIR_FCL)
 else
-PACKAGEDIR_FCL=$(PACKAGEDIR)/fcl
+PACKAGEDIR_FCL=
+ifneq ($(wildcard $(UNITSDIR)/fcl),)
+ifneq ($(wildcard $(UNITSDIR)/fcl/$(OS_TARGET)),)
+UNITDIR_FCL=$(UNITSDIR)/fcl/$(OS_TARGET)
+else
+UNITDIR_FCL=$(UNITSDIR)/fcl
+endif
+else
+UNITDIR_FCL=
+endif
+endif
+ifdef UNITDIR_FCL
+override NEEDUNITDIR+=$(UNITDIR_FCL)
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_FCL)
 
 # Libraries
 
@@ -209,11 +242,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -224,12 +252,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -254,7 +276,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -281,15 +303,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -305,14 +327,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -848,7 +870,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -873,8 +895,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1041,6 +1063,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 84 - 46
packages/opengl/examples/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -167,34 +194,56 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 override PACKAGES+=opengl x11
+ifneq ($(wildcard $(PACKAGEDIR)/opengl),)
 ifneq ($(wildcard $(PACKAGEDIR)/opengl/$(OS_TARGET)),)
 PACKAGEDIR_OPENGL=$(PACKAGEDIR)/opengl/$(OS_TARGET)
 else
 PACKAGEDIR_OPENGL=$(PACKAGEDIR)/opengl
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_OPENGL)
+UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)
+else
+PACKAGEDIR_OPENGL=
+ifneq ($(wildcard $(UNITSDIR)/opengl),)
+ifneq ($(wildcard $(UNITSDIR)/opengl/$(OS_TARGET)),)
+UNITDIR_OPENGL=$(UNITSDIR)/opengl/$(OS_TARGET)
+else
+UNITDIR_OPENGL=$(UNITSDIR)/opengl
+endif
+else
+UNITDIR_OPENGL=
+endif
+endif
+ifdef UNITDIR_OPENGL
+override NEEDUNITDIR+=$(UNITDIR_OPENGL)
+endif
+ifneq ($(wildcard $(PACKAGEDIR)/x11),)
 ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
 PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
 else
 PACKAGEDIR_X11=$(PACKAGEDIR)/x11
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_X11)
+UNITDIR_X11=$(PACKAGEDIR_X11)
+else
+PACKAGEDIR_X11=
+ifneq ($(wildcard $(UNITSDIR)/x11),)
+ifneq ($(wildcard $(UNITSDIR)/x11/$(OS_TARGET)),)
+UNITDIR_X11=$(UNITSDIR)/x11/$(OS_TARGET)
+else
+UNITDIR_X11=$(UNITSDIR)/x11
+endif
+else
+UNITDIR_X11=
+endif
+endif
+ifdef UNITDIR_X11
+override NEEDUNITDIR+=$(UNITDIR_X11)
+endif
 
 # Libraries
 
@@ -215,11 +264,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -230,12 +274,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 # Where to find other libraries
 ifdef inlinux
 ifndef OTHERLIBDIR
@@ -268,7 +306,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -295,15 +333,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -319,14 +357,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -863,7 +901,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -888,8 +926,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1056,6 +1094,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 67 - 45
packages/opengl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -110,27 +110,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -173,28 +200,34 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 override PACKAGES+=x11
+ifneq ($(wildcard $(PACKAGEDIR)/x11),)
 ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
 PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
 else
 PACKAGEDIR_X11=$(PACKAGEDIR)/x11
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_X11)
+UNITDIR_X11=$(PACKAGEDIR_X11)
+else
+PACKAGEDIR_X11=
+ifneq ($(wildcard $(UNITSDIR)/x11),)
+ifneq ($(wildcard $(UNITSDIR)/x11/$(OS_TARGET)),)
+UNITDIR_X11=$(UNITSDIR)/x11/$(OS_TARGET)
+else
+UNITDIR_X11=$(UNITSDIR)/x11
+endif
+else
+UNITDIR_X11=
+endif
+endif
+ifdef UNITDIR_X11
+override NEEDUNITDIR+=$(UNITDIR_X11)
+endif
 
 # Libraries
 
@@ -214,11 +247,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -229,12 +257,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -259,7 +281,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -286,15 +308,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -310,14 +332,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -838,7 +860,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -863,8 +885,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1031,6 +1053,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 50 - 44
packages/postgres/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -830,7 +836,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -855,8 +861,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1023,6 +1029,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 50 - 44
packages/svgalib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -830,7 +836,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -855,8 +861,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1023,6 +1029,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 50 - 44
packages/uncgi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -830,7 +836,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -855,8 +861,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1023,6 +1029,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 50 - 44
packages/utmp/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -830,7 +836,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -855,8 +861,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1023,7 +1029,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 50 - 44
packages/x11/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -167,16 +194,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -201,11 +218,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -216,12 +228,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -246,7 +252,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -273,15 +279,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -297,14 +303,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -810,7 +816,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -835,8 +841,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1003,6 +1009,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 48 - 47
packages/zlib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -164,20 +191,9 @@ ZIPTARGET=install
 
 # Defaults
 
-override NEEDOPT=-Sm
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +218,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +228,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +252,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +279,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,18 +303,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
+ifdef UNITSDIR
+override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
 
-ifdef UNITSDIR
-override FPCOPT+=-Fu$(UNITSDIR)
-endif
-
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -815,7 +816,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -840,8 +841,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1008,6 +1009,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 0 - 3
packages/zlib/Makefile.fpc

@@ -7,6 +7,3 @@ units=zlib
 
 [dirs]
 fpcdir=../..
-
-[require]
-options=-Sm

+ 168 - 206
packages/zlib/zlib.pp

@@ -1,207 +1,169 @@
-unit zlib;
-
-interface
-  
-{ Needed for array of const }
-{$mode objfpc}
-{$PACKRECORDS 4}
-
-const
-  SZLIB_VERSION = '1.1.3';
-
-type
-
-  { Compatibility types }
-  Uint = cardinal;
-  Ulong = Cardinal;
-  Ulongf = Cardinal;
-  Pulongf = ^Ulongf;
-  z_off_t = longint;  
-
-  TAllocfunc = function (opaque:pointer; items:uInt; size:uInt):pointer;cdecl;
-  TFreeFunc = procedure (opaque:pointer; address:pointer);cdecl;
-
-  TInternalState = record
-    end;
-  PInternalState = ^TInternalstate;
-  
-  TZStream = record
-    next_in : pchar;
-    avail_in : uInt;
-    total_in : uLong;
-    next_out : pchar;
-    avail_out : uInt;
-    total_out : uLong;
-    msg : pchar;
-    state : PInternalState;
-    zalloc : TAllocFunc;
-    zfree : TFreeFunc;
-    opaque : pointer;
-    data_type : longint;
-    adler : uLong;
-    reserved : uLong;
-  end;
-  PZstream = ^TZStream;
-  gzFile = pointer;
-
-
-const
-  Z_NO_FLUSH = 0;
-
-  Z_PARTIAL_FLUSH = 1;
-  Z_SYNC_FLUSH = 2;
-  Z_FULL_FLUSH = 3;
-  Z_FINISH = 4;
-
-  Z_OK = 0;
-  Z_STREAM_END = 1;
-  Z_NEED_DICT = 2;
-  Z_ERRNO = -(1);
-  Z_STREAM_ERROR = -(2);
-  Z_DATA_ERROR = -(3);
-  Z_MEM_ERROR = -(4);
-  Z_BUF_ERROR = -(5);
-  Z_VERSION_ERROR = -(6);
-
-  Z_NO_COMPRESSION = 0;
-  Z_BEST_SPEED = 1;
-  Z_BEST_COMPRESSION = 9;
-  Z_DEFAULT_COMPRESSION = -(1);
-
-  Z_FILTERED = 1;
-  Z_HUFFMAN_ONLY = 2;
-  Z_DEFAULT_STRATEGY = 0;
-
-  Z_BINARY = 0;
-  Z_ASCII = 1;
-  Z_UNKNOWN = 2;
-
-  Z_DEFLATED = 8;
-
-  Z_NULL = 0;
-
-  function zlibVersion:pchar;cdecl;
-  function deflate(var strm:TZstream; flush:longint):longint;cdecl;
-  function deflateEnd(var strm:TZstream):longint;cdecl;
-  function inflate(var strm:TZstream; flush:longint):longint;cdecl;
-  function inflateEnd(var strm:TZstream):longint;cdecl;
-  function deflateSetDictionary(var strm:TZstream;dictionary : pchar; dictLength:uInt):longint;cdecl;
-  function deflateCopy(var dest,source:TZstream):longint;cdecl;
-  function deflateReset(var strm:TZstream):longint;cdecl;
-  function deflateParams(var strm:TZstream; level:longint; strategy:longint):longint;cdecl;
-  function inflateSetDictionary(var strm:TZStream;dictionary : pchar; dictLength:uInt):longint;cdecl;
-  function inflateSync(var strm:TZStream):longint;cdecl;
-  function inflateReset(var strm:TZStream):longint;cdecl;
-  function compress(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong):longint;cdecl;
-  function compress2(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong; level:longint):longint;cdecl;
-  function uncompress(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong):longint;cdecl;
-  function gzopen(path:pchar; mode:pchar):gzFile;cdecl;
-  function gzdopen(fd:longint; mode:pchar):gzFile;cdecl;
-  function gzsetparams(Thefile:gzFile; level:longint; strategy:longint):longint;cdecl;
-  function gzread(thefile:gzFile; buf : pointer; len:cardinal):longint;cdecl;
-  function gzwrite(thefile:gzFile; buf: pointer; len:cardinal):longint;cdecl;
-  function gzprintf(thefile:gzFile; format:pchar; args:array of const):longint;cdecl;
-  function gzputs(thefile:gzFile; s:pchar):longint;cdecl;
-  function gzgets(thefile:gzFile; buf:pchar; len:longint):pchar;cdecl;
-  function gzputc(thefile:gzFile; c:longint):longint;cdecl;
-  function gzgetc(thefile:gzFile):longint;cdecl;
-  function gzflush(thefile:gzFile; flush:longint):longint;cdecl;
-  function gzseek(thefile:gzFile; offset:z_off_t; whence:longint):z_off_t;cdecl;
-  function gzrewind(thefile:gzFile):longint;cdecl;
-  function gztell(thefile:gzFile):z_off_t;cdecl;
-  function gzeof(thefile:gzFile):longint;cdecl;
-  function gzclose(thefile:gzFile):longint;cdecl;
-  function gzerror(thefile:gzFile; var errnum:longint):pchar;cdecl;
-  function adler32(adler:uLong;buf : pchar; len:uInt):uLong;cdecl;
-  function crc32(crc:uLong;buf : pchar; len:uInt):uLong;cdecl;
-  function deflateInit_(var strm:TZStream; level:longint; version:pchar; stream_size:longint):longint;cdecl;
-  function inflateInit_(var strm:TZStream; version:pchar; stream_size:longint):longint;cdecl;
-  function deflateInit2_(var strm:TZStream; level:longint; method:longint; windowBits:longint; memLevel:longint; 
-             strategy:longint; version:pchar; stream_size:longint):longint;cdecl;
-  function inflateInit2_(var strm:TZStream; windowBits:longint; version:pchar; stream_size:longint):longint;cdecl;
-  function deflateInit(var strm:TZStream;level : longint) : longint;
-  function inflateInit(var strm:TZStream) : longint;
-  function deflateInit2(var strm:TZStream;level,method,windowBits,memLevel,strategy : longint) : longint;
-  function inflateInit2(var strm:TZStream; windowBits : longint) : longint;
-  function zError(err:longint):pchar;cdecl;
-  function inflateSyncPoint(z:PZstream):longint;cdecl;
-  function get_crc_table:puLongf;cdecl;
-
-implementation
-
-{$ifndef win32}
-const External_library='z';
-{$else}
-const External_library='z';
-{$endif}
-
-
-function zlibVersion:pchar;cdecl;external External_library name 'zlibVersion';
-function deflate(var strm:TZStream; flush:longint):longint;cdecl;external External_library name 'deflate';
-function deflateEnd(var strm:TZStream):longint;cdecl;external External_library name 'deflateEnd';
-function inflate(var strm:TZStream; flush:longint):longint;cdecl;external External_library name 'inflate';
-function inflateEnd(var strm:TZStream):longint;cdecl;external External_library name 'inflateEnd';
-function deflateSetDictionary(var strm:TZStream;dictionary : pchar; dictLength:uInt):longint;cdecl;external External_library name 'deflateSetDictionary';
-function deflateCopy(var dest,source:TZstream):longint;cdecl;external External_library name 'deflateCopy';
-function deflateReset(var strm:TZStream):longint;cdecl;external External_library name 'deflateReset';
-function deflateParams(var strm:TZStream; level:longint; strategy:longint):longint;cdecl;external External_library name 'deflateParams';
-function inflateSetDictionary(var strm:TZStream;dictionary : pchar; dictLength:uInt):longint;cdecl;external External_library name 'inflateSetDictionary';
-function inflateSync(var strm:TZStream):longint;cdecl;external External_library name 'inflateSync';
-function inflateReset(var strm:TZStream):longint;cdecl;external External_library name 'inflateReset';
-function compress(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong):longint;cdecl;external External_library name 'compress';
-function compress2(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong; level:longint):longint;cdecl;external External_library name 'compress2';
-function uncompress(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong):longint;cdecl;external External_library name 'uncompress';
-function gzopen(path:pchar; mode:pchar):gzFile;cdecl;external External_library name 'gzopen';
-function gzdopen(fd:longint; mode:pchar):gzFile;cdecl;external External_library name 'gzdopen';
-function gzsetparams(thefile:gzFile; level:longint; strategy:longint):longint;cdecl;external External_library name 'gzsetparams';
-function gzread(thefile:gzFile; buf:pointer; len:cardinal):longint;cdecl;external External_library name 'gzread';
-function gzwrite(thefile:gzFile; buf:pointer; len:cardinal):longint;cdecl;external External_library name 'gzwrite';
-function gzprintf(thefile:gzFile; format:pchar; args:array of const):longint;cdecl;external External_library name 'gzprintf';
-function gzputs(thefile:gzFile; s:pchar):longint;cdecl;external External_library name 'gzputs';
-function gzgets(thefile:gzFile; buf:pchar; len:longint):pchar;cdecl;external External_library name 'gzgets';
-function gzputc(thefile:gzFile; c:longint):longint;cdecl;external External_library name 'gzputc';
-function gzgetc(thefile:gzFile):longint;cdecl;external External_library name 'gzgetc';
-function gzflush(thefile:gzFile; flush:longint):longint;cdecl;external External_library name 'gzflush';
-function gzseek(thefile:gzFile; offset:z_off_t; whence:longint):z_off_t;cdecl;external External_library name 'gzseek';
-function gzrewind(thefile:gzFile):longint;cdecl;external External_library name 'gzrewind';
-function gztell(thefile:gzFile):z_off_t;cdecl;external External_library name 'gztell';
-function gzeof(thefile:gzFile):longint;cdecl;external External_library name 'gzeof';
-function gzclose(thefile:gzFile):longint;cdecl;external External_library name 'gzclose';
-function gzerror(thefile:gzFile; var errnum:longint):pchar;cdecl;external External_library name 'gzerror';
-function adler32(adler:uLong;buf : pchar; len:uInt):uLong;cdecl;external External_library name 'adler32';
-function crc32(crc:uLong;buf : pchar; len:uInt):uLong;cdecl;external External_library name 'crc32';
-function deflateInit_(var strm:TZStream; level:longint; version:pchar; stream_size:longint):longint;cdecl;external External_library name 'deflateInit_';
-function inflateInit_(var strm:TZStream; version:pchar; stream_size:longint):longint;cdecl;external External_library name 'inflateInit_';
-function deflateInit2_(var strm:TZStream; level:longint; method:longint; windowBits:longint; memLevel:longint; 
-           strategy:longint; version:pchar; stream_size:longint):longint;cdecl;external External_library name 'deflateInit2_';
-function inflateInit2_(var strm:TZStream; windowBits:longint; version:pchar; stream_size:longint):longint;cdecl;external External_library name 'inflateInit2_';
-function zError(err:longint):pchar;cdecl;external External_library name 'zError';
-function inflateSyncPoint(z:PZstream):longint;cdecl;external External_library name 'inflateSyncPoint';
-function get_crc_table:puLongf;cdecl;external External_library name 'get_crc_table';
-
-function zlib_version : pchar;
-  begin
-     zlib_version:=zlibVersion;
-  end;
-
-function deflateInit(var strm:TZStream;level : longint) : longint;
-  begin
-     deflateInit:=deflateInit_(strm,level,ZLIB_VERSION,sizeof(TZStream));
-  end;
-
-function inflateInit(var strm:TZStream) : longint;
-  begin
-     inflateInit:=inflateInit_(strm,ZLIB_VERSION,sizeof(TZStream));
-  end;
-
-function deflateInit2(var strm:TZStream;level,method,windowBits,memLevel,strategy : longint) : longint;
-  begin
-     deflateInit2:=deflateInit2_(strm,level,method,windowBits,memLevel,strategy,ZLIB_VERSION,sizeof(TZStream));
-  end;
-
-function inflateInit2(var strm:TZStream;windowBits : longint) : longint;
-  begin
-     inflateInit2:=inflateInit2_(strm,windowBits,ZLIB_VERSION,sizeof(TZStream));
-  end;
-
+unit zlib;
+
+interface
+
+{ Needed for array of const }
+{$mode objfpc}
+{$PACKRECORDS 4}
+
+const
+  ZLIB_VERSION = '1.1.3';
+
+  libz='z';
+
+type
+
+  { Compatibility types }
+  Uint = cardinal;
+  Ulong = Cardinal;
+  Ulongf = Cardinal;
+  Pulongf = ^Ulongf;
+  z_off_t = longint;
+
+  TAllocfunc = function (opaque:pointer; items:uInt; size:uInt):pointer;cdecl;
+  TFreeFunc = procedure (opaque:pointer; address:pointer);cdecl;
+
+  TInternalState = record
+    end;
+  PInternalState = ^TInternalstate;
+
+  TZStream = record
+    next_in : pchar;
+    avail_in : uInt;
+    total_in : uLong;
+    next_out : pchar;
+    avail_out : uInt;
+    total_out : uLong;
+    msg : pchar;
+    state : PInternalState;
+    zalloc : TAllocFunc;
+    zfree : TFreeFunc;
+    opaque : pointer;
+    data_type : longint;
+    adler : uLong;
+    reserved : uLong;
+  end;
+  PZstream = ^TZStream;
+  gzFile = pointer;
+
+
+const
+  Z_NO_FLUSH = 0;
+
+  Z_PARTIAL_FLUSH = 1;
+  Z_SYNC_FLUSH = 2;
+  Z_FULL_FLUSH = 3;
+  Z_FINISH = 4;
+
+  Z_OK = 0;
+  Z_STREAM_END = 1;
+  Z_NEED_DICT = 2;
+  Z_ERRNO = -(1);
+  Z_STREAM_ERROR = -(2);
+  Z_DATA_ERROR = -(3);
+  Z_MEM_ERROR = -(4);
+  Z_BUF_ERROR = -(5);
+  Z_VERSION_ERROR = -(6);
+
+  Z_NO_COMPRESSION = 0;
+  Z_BEST_SPEED = 1;
+  Z_BEST_COMPRESSION = 9;
+  Z_DEFAULT_COMPRESSION = -(1);
+
+  Z_FILTERED = 1;
+  Z_HUFFMAN_ONLY = 2;
+  Z_DEFAULT_STRATEGY = 0;
+
+  Z_BINARY = 0;
+  Z_ASCII = 1;
+  Z_UNKNOWN = 2;
+
+  Z_DEFLATED = 8;
+
+  Z_NULL = 0;
+
+function zlibVersionPchar:pchar;cdecl;external libz name 'zlibVersion';
+function zlibVersion:string;
+function deflate(var strm:TZStream; flush:longint):longint;cdecl;external libz name 'deflate';
+function deflateEnd(var strm:TZStream):longint;cdecl;external libz name 'deflateEnd';
+function inflate(var strm:TZStream; flush:longint):longint;cdecl;external libz name 'inflate';
+function inflateEnd(var strm:TZStream):longint;cdecl;external libz name 'inflateEnd';
+function deflateSetDictionary(var strm:TZStream;dictionary : pchar; dictLength:uInt):longint;cdecl;external libz name 'deflateSetDictionary';
+function deflateCopy(var dest,source:TZstream):longint;cdecl;external libz name 'deflateCopy';
+function deflateReset(var strm:TZStream):longint;cdecl;external libz name 'deflateReset';
+function deflateParams(var strm:TZStream; level:longint; strategy:longint):longint;cdecl;external libz name 'deflateParams';
+function inflateSetDictionary(var strm:TZStream;dictionary : pchar; dictLength:uInt):longint;cdecl;external libz name 'inflateSetDictionary';
+function inflateSync(var strm:TZStream):longint;cdecl;external libz name 'inflateSync';
+function inflateReset(var strm:TZStream):longint;cdecl;external libz name 'inflateReset';
+function compress(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong):longint;cdecl;external libz name 'compress';
+function compress2(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong; level:longint):longint;cdecl;external libz name 'compress2';
+function uncompress(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong):longint;cdecl;external libz name 'uncompress';
+function gzopen(path:pchar; mode:pchar):gzFile;cdecl;external libz name 'gzopen';
+function gzdopen(fd:longint; mode:pchar):gzFile;cdecl;external libz name 'gzdopen';
+function gzsetparams(thefile:gzFile; level:longint; strategy:longint):longint;cdecl;external libz name 'gzsetparams';
+function gzread(thefile:gzFile; buf:pointer; len:cardinal):longint;cdecl;external libz name 'gzread';
+function gzwrite(thefile:gzFile; buf:pointer; len:cardinal):longint;cdecl;external libz name 'gzwrite';
+function gzprintf(thefile:gzFile; format:pchar; args:array of const):longint;cdecl;external libz name 'gzprintf';
+function gzputs(thefile:gzFile; s:pchar):longint;cdecl;external libz name 'gzputs';
+function gzgets(thefile:gzFile; buf:pchar; len:longint):pchar;cdecl;external libz name 'gzgets';
+function gzputc(thefile:gzFile; c:char):char;cdecl;external libz name 'gzputc';
+function gzgetc(thefile:gzFile):char;cdecl;external libz name 'gzgetc';
+function gzflush(thefile:gzFile; flush:longint):longint;cdecl;external libz name 'gzflush';
+function gzseek(thefile:gzFile; offset:z_off_t; whence:longint):z_off_t;cdecl;external libz name 'gzseek';
+function gzrewind(thefile:gzFile):longint;cdecl;external libz name 'gzrewind';
+function gztell(thefile:gzFile):z_off_t;cdecl;external libz name 'gztell';
+function gzeof(thefile:gzFile):longbool;cdecl;external libz name 'gzeof';
+function gzclose(thefile:gzFile):longint;cdecl;external libz name 'gzclose';
+function gzerror(thefile:gzFile; var errnum:longint):pchar;cdecl;external libz name 'gzerror';
+function adler32(adler:uLong;buf : pchar; len:uInt):uLong;cdecl;external libz name 'adler32';
+function crc32(crc:uLong;buf : pchar; len:uInt):uLong;cdecl;external libz name 'crc32';
+function deflateInit_(var strm:TZStream; level:longint; version:pchar; stream_size:longint):longint;cdecl;external libz name 'deflateInit_';
+function inflateInit_(var strm:TZStream; version:pchar; stream_size:longint):longint;cdecl;external libz name 'inflateInit_';
+function deflateInit(var strm:TZStream;level : longint) : longint;
+function inflateInit(var strm:TZStream) : longint;
+function deflateInit2_(var strm:TZStream; level:longint; method:longint; windowBits:longint; memLevel:longint;strategy:longint; version:pchar; stream_size:longint):longint;cdecl;external libz name 'deflateInit2_';
+function inflateInit2_(var strm:TZStream; windowBits:longint; version:pchar; stream_size:longint):longint;cdecl;external libz name 'inflateInit2_';
+function deflateInit2(var strm:TZStream;level,method,windowBits,memLevel,strategy : longint) : longint;
+function inflateInit2(var strm:TZStream;windowBits : longint) : longint;
+function zErrorPchar(err:longint):pchar;cdecl;external libz name 'zError';
+function zError(err:longint):string;
+function inflateSyncPoint(z:PZstream):longint;cdecl;external libz name 'inflateSyncPoint';
+function get_crc_table:pointer;cdecl;external libz name 'get_crc_table';
+
+
+implementation
+
+uses
+  strings;
+
+function zlibversion : string;
+  begin
+     zlibversion:=strpas(zlibversionPchar);
+  end;
+
+function deflateInit(var strm:TZStream;level : longint) : longint;
+  begin
+     deflateInit:=deflateInit_(strm,level,ZLIB_VERSION,sizeof(TZStream));
+  end;
+
+function inflateInit(var strm:TZStream) : longint;
+  begin
+     inflateInit:=inflateInit_(strm,ZLIB_VERSION,sizeof(TZStream));
+  end;
+
+function deflateInit2(var strm:TZStream;level,method,windowBits,memLevel,strategy : longint) : longint;
+  begin
+     deflateInit2:=deflateInit2_(strm,level,method,windowBits,memLevel,strategy,ZLIB_VERSION,sizeof(TZStream));
+  end;
+
+function inflateInit2(var strm:TZStream;windowBits : longint) : longint;
+  begin
+     inflateInit2:=inflateInit2_(strm,windowBits,ZLIB_VERSION,sizeof(TZStream));
+  end;
+
+function zError(err:longint):string;
+  begin
+     zerror:=Strpas(zErrorPchar(err));
+  end;
+
 end.

+ 30 - 16
rtl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -108,18 +108,42 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -162,16 +186,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 

+ 51 - 44
rtl/go32v1/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -111,27 +111,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=.
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=.
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -183,6 +210,7 @@ override UNITOBJECTS+=$(SYSTEMUNIT) objpas strings go32 dos crt objects printer
 
 # Install
 
+UNITSUBDIR=rtl
 ZIPTARGET=install
 
 # Defaults
@@ -190,16 +218,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDINCDIR=$(INC) $(PROCINC)
 ifndef TARGETDIR
 TARGETDIR=.
@@ -245,11 +263,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -260,12 +273,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -290,7 +297,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -317,15 +324,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -341,14 +348,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDINCDIR
 override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
 endif
@@ -881,7 +888,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -906,8 +913,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1074,7 +1081,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 3 - 0
rtl/go32v1/Makefile.fpc

@@ -18,6 +18,9 @@ rtl=0
 defaulttarget=go32v1
 defaultcpu=i386
 
+[install]
+unitsubdir=rtl
+
 [dirs]
 fpcdir=.
 incdir=$(INC) $(PROCINC)

+ 51 - 44
rtl/go32v2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -111,27 +111,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=.
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=.
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -183,6 +210,7 @@ override UNITOBJECTS+=$(SYSTEMUNIT) objpas strings go32 initc dpmiexcp profile d
 
 # Install
 
+UNITSUBDIR=rtl
 ZIPTARGET=install
 
 # Defaults
@@ -190,16 +218,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDINCDIR=$(INC) $(PROCINC)
 ifndef TARGETDIR
 TARGETDIR=.
@@ -245,11 +263,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -260,12 +273,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -290,7 +297,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -317,15 +324,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -341,14 +348,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDINCDIR
 override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
 endif
@@ -881,7 +888,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -906,8 +913,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1074,7 +1081,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 3 - 0
rtl/go32v2/Makefile.fpc

@@ -18,6 +18,9 @@ rtl=0
 defaulttarget=go32v2
 defaultcpu=i386
 
+[install]
+unitsubdir=rtl
+
 [dirs]
 fpcdir=.
 incdir=$(INC) $(PROCINC)

+ 51 - 44
rtl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -111,27 +111,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=.
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=.
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -192,6 +219,7 @@ override UNITOBJECTS+=$(SYSTEMUNIT) objpas strings linux ports dos crt objects p
 
 # Install
 
+UNITSUBDIR=rtl
 ZIPTARGET=install
 
 # Defaults
@@ -199,16 +227,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDINCDIR=$(INC) $(PROCINC)
 ifndef TARGETDIR
 TARGETDIR=.
@@ -256,11 +274,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -271,12 +284,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -301,7 +308,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -328,15 +335,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -352,14 +359,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDINCDIR
 override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
 endif
@@ -892,7 +899,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -917,8 +924,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1085,7 +1092,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 3 - 0
rtl/linux/Makefile.fpc

@@ -18,6 +18,9 @@ rtl=0
 defaulttarget=linux
 defaultcpu=i386
 
+[install]
+unitsubdir=rtl
+
 [dirs]
 fpcdir=.
 incdir=$(INC) $(PROCINC)

+ 51 - 44
rtl/os2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -111,27 +111,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=.
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=.
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -183,6 +210,7 @@ override UNITOBJECTS+=$(SYSTEMUNIT) objpas strings os2def doscalls moncalls kbdc
 
 # Install
 
+UNITSUBDIR=rtl
 ZIPTARGET=install
 
 # Defaults
@@ -190,16 +218,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDINCDIR=$(INC) $(PROCINC)
 ifndef TARGETDIR
 TARGETDIR=.
@@ -245,11 +263,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -260,12 +273,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -290,7 +297,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -317,15 +324,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -341,14 +348,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDINCDIR
 override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
 endif
@@ -881,7 +888,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -906,8 +913,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1074,7 +1081,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 3 - 0
rtl/os2/Makefile.fpc

@@ -17,6 +17,9 @@ rtl=0
 defaulttarget=os2
 defaultcpu=i386
 
+[install]
+unitsubdir=rtl
+
 [dirs]
 fpcdir=.
 incdir=$(INC) $(PROCINC)

+ 51 - 44
rtl/win32/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -111,27 +111,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=.
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=.
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -188,6 +215,7 @@ override UNITOBJECTS+=$(SYSTEMUNIT) objpas strings windows ole2 opengl32 winsock
 
 # Install
 
+UNITSUBDIR=rtl
 ZIPTARGET=install
 
 # Defaults
@@ -195,16 +223,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 override NEEDINCDIR=$(INC) $(PROCINC)
 ifndef TARGETDIR
 TARGETDIR=.
@@ -250,11 +268,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -265,12 +278,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -295,7 +302,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -322,15 +329,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -346,14 +353,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDINCDIR
 override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
 endif
@@ -886,7 +893,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -911,8 +918,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1079,7 +1086,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 3 - 0
rtl/win32/Makefile.fpc

@@ -18,6 +18,9 @@ rtl=0
 defaulttarget=win32
 defaultcpu=i386
 
+[install]
+unitsubdir=rtl
+
 [dirs]
 fpcdir=.
 incdir=$(INC) $(PROCINC)

+ 30 - 16
tests/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: info
@@ -108,18 +108,42 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -161,16 +185,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 

+ 70 - 48
utils/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -169,16 +196,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 ifndef TARGETDIR
 TARGETDIR=.
 endif
@@ -188,12 +205,28 @@ endif
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 override PACKAGES+=fcl
-ifneq ($(wildcard $(PACKAGEDIR)/fcl/$(OS_TARGET)),)
-PACKAGEDIR_FCL=$(PACKAGEDIR)/fcl/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/fcl),)
+ifneq ($(wildcard $(FPCDIR)/fcl/$(OS_TARGET)),)
+PACKAGEDIR_FCL=$(FPCDIR)/fcl/$(OS_TARGET)
+else
+PACKAGEDIR_FCL=$(FPCDIR)/fcl
+endif
+UNITDIR_FCL=$(PACKAGEDIR_FCL)
 else
-PACKAGEDIR_FCL=$(PACKAGEDIR)/fcl
+PACKAGEDIR_FCL=
+ifneq ($(wildcard $(UNITSDIR)/fcl),)
+ifneq ($(wildcard $(UNITSDIR)/fcl/$(OS_TARGET)),)
+UNITDIR_FCL=$(UNITSDIR)/fcl/$(OS_TARGET)
+else
+UNITDIR_FCL=$(UNITSDIR)/fcl
+endif
+else
+UNITDIR_FCL=
+endif
+endif
+ifdef UNITDIR_FCL
+override NEEDUNITDIR+=$(UNITDIR_FCL)
 endif
-override NEEDUNITDIR+=$(PACKAGEDIR_FCL)
 
 # Libraries
 
@@ -213,11 +246,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -228,12 +256,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -258,7 +280,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -285,15 +307,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -309,14 +331,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
@@ -860,7 +882,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -885,8 +907,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1053,7 +1075,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 

File diff suppressed because it is too large
+ 193 - 183
utils/fpcmake.inc


+ 42 - 29
utils/fpcmake.ini

@@ -110,23 +110,43 @@ endif
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
 
-[fpcdirdetect]
+[fpcdircheckenv]
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
 endif
 
+[fpcdirdetect]
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+[fpcdirsubs]
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -169,11 +189,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -184,12 +199,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 
 [dir_install]
 #####################################################################
@@ -216,7 +225,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -243,15 +252,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -294,6 +303,12 @@ override FPCOPT+=$(NEEDOPT)
 endif
 
 
+[command_needunit]
+ifdef NEEDUNITDIR
+override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
+endif
+
+
 [command_rtldir]
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
@@ -305,21 +320,19 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
-[command_needunit]
-ifdef NEEDUNITDIR
-override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
-endif
 
 [command_needlib]
 ifdef NEEDLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(NEEDLIBDIR))
 endif
 
+
 [command_needobj]
 ifdef NEEDOBJDIR
 override FPCOPT+=$(addprefix -Fo,$(NEEDOBJDIR))
 endif
 
+
 [command_needinc]
 ifdef NEEDINCDIR
 override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
@@ -964,7 +977,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-        @$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+        @$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -989,8 +1002,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-        $(MKDIR) $(EXTRAINSTALLDIR)
-        $(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+        $(MKDIR) $(DATAINSTALLDIR)
+        $(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 
@@ -1236,7 +1249,7 @@ endif
         @$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
         @$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
         @$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-        @$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+        @$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
         @$(ECHO)
 
 [userrules]

+ 90 - 51
utils/fpcmake.pp

@@ -39,9 +39,13 @@ type
 
   tbic=(bic_none,bic_build,bic_install,bic_clean);
 
+  tspecialdir=record
+    dir,unitdir,packdir : string;
+  end;
+
+
 const
-  EnvVar='FPCMAKEINI'; { should be FPCMAKE in the future }
-  TimeFormat='yyyy/mm/dd hh:nn';
+  EnvVar='FPCMAKEINI';
 
   sectionstr : array[tsections] of string=('none',
     'units','exes','loaders','examples','package',
@@ -97,6 +101,14 @@ const
     true,false
   );
 
+  specialdirs = 4;
+  specialdir : array[1..specialdirs] of tspecialdir=(
+    (dir: 'rtl';  unitdir: '$(UNITSDIR)/rtl';  packdir: '$(FPCDIR)/rtl'),
+    (dir: 'fcl';  unitdir: '$(UNITSDIR)/fcl';  packdir: '$(FPCDIR)/fcl'),
+    (dir: 'api';  unitdir: '$(UNITSDIR)/api';  packdir: '$(FPCDIR)/api'),
+    (dir: 'fv';   unitdir: '$(UNITSDIR)/fv';   packdir: '$(FPCDIR)/fv')
+  );
+
 { Sections in Makefile.fpc }
   ini_sections='sections';
   ini_install='install';
@@ -119,9 +131,10 @@ type
     TargetPrograms,
     TargetExamples,
     TargetRST      : TTargetsString;
-    InstallUnitSub,
-    InstallPrefix,
-    InstallBase    : string;
+    InstallUnitSubDir,
+    InstallPrefixDir,
+    InstallDataDir,
+    InstallBaseDir : string;
     InstallUnits,
     InstallFiles   : TTargetsString;
     CleanUnits,
@@ -169,6 +182,7 @@ type
     ToolsUpx,
     ToolsDate,
     ToolsZip       : boolean;
+    MultiPacks,
     PreSettings,
     PostSettings,
     Rules          : TStringList;
@@ -296,9 +310,10 @@ begin
      ReadTargetsString(CleanUnits,ini_clean,'units','');
      ReadTargetsString(CleanFiles,ini_clean,'files','');
    { install }
-     InstallPrefix:=ReadString(ini_install,'dirprefix','');
-     InstallBase:=ReadString(ini_install,'dirbase','');
-     InstallUnitSub:=ReadString(ini_install,'unitsubdir','');
+     InstallPrefixDir:=ReadString(ini_install,'dirprefix','');
+     InstallBaseDir:=ReadString(ini_install,'basedir','');
+     InstallDataDir:=ReadString(ini_install,'datadir','');
+     InstallUnitSubDir:=ReadString(ini_install,'unitsubdir','');
      ReadTargetsString(InstallUnits,ini_install,'units','');
      ReadTargetsString(InstallFiles,ini_install,'files','');
    { zip }
@@ -319,7 +334,7 @@ begin
      ReadTargetsString(requirePackages,ini_require,'packages','');
    { dirs }
      DirFpc:=ReadString(ini_dirs,'fpcdir','');
-     DirPackage:=ReadString(ini_dirs,'packagedir','');
+     DirPackage:=ReadString(ini_dirs,'packagedir','$(FPCDIR)/packages');
      DirComponent:=ReadString(ini_dirs,'componentdir','$(FPCDIR)/components');
      DirUnit:=ReadString(ini_dirs,'unitdir','');
      DirLib:=ReadString(ini_dirs,'libdir','');
@@ -367,6 +382,9 @@ begin
      InfoTools:=ReadBool(ini_info,'infotools',false);
      InfoInstall:=ReadBool(ini_info,'infoinstall',true);
      InfoObjects:=ReadBool(ini_info,'infoobjects',true);
+   { multipacks }
+     MultiPacks:=TStringList.Create;
+     ReadSectionRaw('multipack',MultiPacks);
    { rules }
      PreSettings:=TStringList.Create;
      ReadSectionRaw('presettings',PreSettings);
@@ -557,10 +575,10 @@ var
       end;
   end;
 
-  procedure AddTargetsUnitDir(const pre:string;var t:TTargetsString);
+  procedure AddTargetsUnitDir(const packpre:string;var t:TTargetsString);
   var
-    i,j : integer;
-    hs,packdirvar,packdir : string;
+    i,j,k : integer;
+    hs,pack,packdirvar,unitdirvar,unitdir,packdir : string;
   begin
     for i:=0 to targets do
      if (t[i]<>'') then
@@ -570,14 +588,42 @@ var
           j:=pos(' ',hs);
           if j=0 then
            j:=length(hs)+1;
-          packdirvar:='PACKAGEDIR_'+Uppercase(Copy(hs,1,j-1));
-          packdir:=pre+'/'+Copy(hs,1,j-1);
+          pack:=Copy(hs,1,j-1);
+          packdirvar:='PACKAGEDIR_'+Uppercase(pack);
+          unitdirvar:='UNITDIR_'+Uppercase(pack);
+          packdir:=packpre+'/'+pack;
+          unitdir:='$(UNITSDIR)/'+pack;
+          for k:=1to specialdirs do
+           begin
+             if specialdir[k].dir=pack then
+              begin
+                packdir:=specialdir[k].packdir;
+                unitdir:=specialdir[k].unitdir;
+                break;
+              end;
+           end;
+          mf.Add('ifneq ($(wildcard '+packdir+'),)');
           mf.Add('ifneq ($(wildcard '+packdir+'/$(OS_TARGET)),)');
           mf.Add(packdirvar+'='+packdir+'/$(OS_TARGET)');
           mf.Add('else');
           mf.Add(packdirvar+'='+packdir);
           mf.Add('endif');
-          mf.Add('override NEEDUNITDIR+=$('+packdirvar+')');
+          mf.Add(unitdirvar+'=$('+packdirvar+')');
+          mf.Add('else');
+          mf.Add(packdirvar+'=');
+          mf.Add('ifneq ($(wildcard '+unitdir+'),)');
+          mf.Add('ifneq ($(wildcard '+unitdir+'/$(OS_TARGET)),)');
+          mf.Add(unitdirvar+'='+unitdir+'/$(OS_TARGET)');
+          mf.Add('else');
+          mf.Add(unitdirvar+'='+unitdir);
+          mf.Add('endif');
+          mf.Add('else');
+          mf.Add(unitdirvar+'=');
+          mf.Add('endif');
+          mf.Add('endif');
+          mf.Add('ifdef '+unitdirvar);
+          mf.Add('override NEEDUNITDIR+=$('+unitdirvar+')');
+          mf.Add('endif');
           system.delete(hs,1,j);
         until hs='';
       end;
@@ -605,18 +651,6 @@ var
     mf.Add('endif');
   end;
 
-  procedure AddDirDetect(const varname,checkdir,elsedir:string);
-  begin
-    mf.Add('ifneq ($(wildcard '+checkdir+'),)');
-    mf.Add(varname+'='+checkdir);
-    if elsedir<>'' then
-     begin
-       mf.Add('else');
-       mf.Add(varname+'='+elsedir);
-     end;
-    mf.Add('endif');
-  end;
-
   procedure AddPackageDep(const s:string);
   var
     packagedir : string;
@@ -696,16 +730,29 @@ begin
      AddSection(true,'fpcdetect');
 
    { fpc dir }
+     AddSection(true,'fpcdircheckenv');
      if userini.dirfpc<>'' then
       begin
         Add('# Default FPCDIR');
-        Add('ifndef FPCDIR');
-        Add('FPCDIR='+userini.dirfpc);
+        Add('ifeq ($(FPCDIR),wrong)');
+        Add('override FPCDIR='+userini.dirfpc);
+        Add('ifeq ($(wildcard $(FPCDIR)/rtl),)');
+        Add('override FPCDIR=wrong');
+        Add('endif');
         Add('endif');
         Add('');
       end;
      AddSection(true,'fpcdirdetect');
 
+   { fpcdir subdirs }
+     Add('ifndef PACKAGEDIR');
+     Add('PACKAGEDIR='+userini.dirpackage);
+     Add('endif');
+     Add('ifndef COMPONENTDIR');
+     Add('COMPONENTDIR='+userini.dircomponent);
+     Add('endif');
+     AddSection(true,'fpcdirsubs');
+
    { write the default & user settings }
      AddSection(true,'defaultsettings');
      AddSection(true,'usersettings');
@@ -735,12 +782,14 @@ begin
      AddHead('Install');
      AddTargets('EXTRAINSTALLUNITS',userini.installunits,false);
      AddTargets('EXTRAINSTALLFILES',userini.installfiles,false);
-     if userini.installprefix<>'' then
-      Add('PREFIXINSTALLDIR='+userini.installprefix);
-     if userini.installbase<>'' then
-      Add('BASEINSTALLDIR='+userini.installbase);
-     if userini.InstallUnitSub>'' then
-      Add('UNITSUBDIR='+userini.InstallUnitSub);
+     if userini.installprefixdir<>'' then
+      Add('PREFIXINSTALLDIR='+userini.installprefixdir);
+     if userini.installbasedir<>'' then
+      Add('BASEINSTALLDIR='+userini.installbasedir);
+     if userini.installdatadir<>'' then
+      Add('DATAINSTALLDIR='+userini.installdatadir);
+     if userini.InstallUnitSubDir<>'' then
+      Add('UNITSUBDIR='+userini.InstallUnitSubDir);
 
    { Zip }
      if userini.zipname<>'' then
@@ -757,20 +806,6 @@ begin
      AddHead('Directories');
      if userini.dirsources<>'' then
       Add('vpath %$(PASEXT) '+userini.dirsources);
-     { packages dir }
-     Add('ifndef PACKAGEDIR');
-     if userini.dirpackage<>'' then
-      Add('PACKAGEDIR='+userini.dirpackage)
-     else
-      AddDirDetect('PACKAGEDIR','$(FPCDIR)/packages','$(FPCDIR)/units/$(OS_TARGET)');
-     Add('endif');
-     { component dir }
-     Add('ifndef COMPONENTDIR');
-     if userini.dircomponent<>'' then
-      Add('COMPONENTDIR='+userini.dircomponent)
-     else
-      AddDirDetect('COMPONENTDIR','$(FPCDIR)/components','$(FPCDIR)/units/$(OS_TARGET)');
-     Add('endif');
      if userini.dirunit<>'' then
       Add('override NEEDUNITDIR='+userini.dirunit);
      if userini.dirlib<>'' then
@@ -856,8 +891,8 @@ begin
         Add('');
         AddSection(true,'command_begin');
         AddSection((userini.Requireoptions<>''),'command_needopt');
-        AddSection((userini.dirfpc<>''),'command_rtldir');
         AddSection((userini.dirfpc<>''),'command_unitsdir');
+        AddSection((userini.dirfpc<>''),'command_rtldir');
         AddSection((userini.dirunit<>'') or
                    (not TargetStringEmpty(userini.Requirepackages)) or
                    (not TargetStringEmpty(userini.Requirecomponents))
@@ -1057,7 +1092,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.17  2000-01-04 00:00:23  peter
+  Revision 1.18  2000-01-06 01:29:59  peter
+    * FPCDIR setting/detect
+    * lot of other updates to create .deb files correctly
+
+  Revision 1.17  2000/01/04 00:00:23  peter
     * Makefile updates again
 
   Revision 1.16  2000/01/03 19:42:41  peter

+ 50 - 44
utils/h2pas/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -169,16 +196,6 @@ override NEEDOPT=-Sg
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -203,11 +220,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -218,12 +230,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -248,7 +254,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -275,15 +281,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -303,14 +309,14 @@ ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -817,7 +823,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -842,8 +848,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1010,7 +1016,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 50 - 44
utils/simulator/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -168,16 +195,6 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -202,11 +219,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -217,12 +229,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -247,7 +253,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -274,15 +280,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -298,14 +304,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -812,7 +818,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -837,8 +843,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1005,6 +1011,6 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 

+ 52 - 45
utils/tply/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/04]
+# Makefile generated by fpcmake v0.99.13 [2000/01/06]
 #
 
 defaultrule: all
@@ -104,27 +104,54 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Default FPCDIR
-ifndef FPCDIR
-FPCDIR=../..
-endif
-
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=
+override FPCDIR=wrong
 endif
 else
-override FPCDIR=
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
 # Detect FPCDIR
-ifeq ($(FPCDIR),)
+ifeq ($(FPCDIR),wrong)
 ifdef inlinux
-FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+# Check if packagedir really exists else turn it off
+ifeq ($(wildcard $(PACKAGEDIR)),)
+PACKAGEDIR=
+endif
+ifeq ($(wildcard $(COMPONENTDIR)),)
+COMPONENTDIR=
+endif
+
+# Create rtl,units dir
+ifneq ($(FPCDIR),.)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override RTLDIR=$(UNITSDIR)/rtl
 endif
 endif
 
@@ -154,7 +181,7 @@ endif
 # Pre Settings
 
 ifdef inlinux
-CODPATH=/usr/lib/fpc/lexyacc
+CODPATH=$(PREFIXINSTALLDIR)/lib/fpc/lexyacc
 else
 CODPATH=$(BININSTALLDIR)
 endif
@@ -171,6 +198,7 @@ override EXTRACLEANUNITS+=lexbase lexopt lexdfa lexpos lexlist lexrules lexmsgs
 # Install
 
 override EXTRAINSTALLFILES+=yylex.cod yyparse.cod
+DATAINSTALLDIR=$(CODPATH)
 ZIPTARGET=install
 
 # Defaults
@@ -179,16 +207,6 @@ override NEEDOPT=-Sg
 
 # Directories
 
-ifndef PACKAGEDIR
-ifneq ($(wildcard $(FPCDIR)/packages),)
-PACKAGEDIR=$(FPCDIR)/packages
-else
-PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
@@ -213,11 +231,6 @@ else
 BASEDIR=.
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -228,12 +241,6 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Create rtl,fcl,units dir
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
 #####################################################################
 # Install Directories
 #####################################################################
@@ -258,7 +265,7 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
 ifdef UNITSUBDIR
 UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
 endif
@@ -285,15 +292,15 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -313,14 +320,14 @@ ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
-endif
-
 ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -841,7 +848,7 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -866,8 +873,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -1034,7 +1041,7 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################

+ 2 - 2
utils/tply/Makefile.fpc

@@ -12,10 +12,10 @@ units=lexbase lexopt lexdfa lexpos lexlist lexrules lexmsgs lextable \
 
 [install]
 files=yylex.cod yyparse.cod
+datadir=$(CODPATH)
 
 [dirs]
 fpcdir=../..
-extrainstalldir=$(CODPATH)
 
 [require]
 options=-Sg
@@ -23,7 +23,7 @@ options=-Sg
 
 [presettings]
 ifdef inlinux
-CODPATH=/usr/lib/fpc/lexyacc
+CODPATH=$(PREFIXINSTALLDIR)/lib/fpc/lexyacc
 else
 CODPATH=$(BININSTALLDIR)
 endif

Some files were not shown because too many files changed in this diff