Browse Source

* regenerated

peter 25 years ago
parent
commit
20a3fba0fb
74 changed files with 4252 additions and 3330 deletions
  1. 39 39
      api/Makefile
  2. 56 46
      api/go32v2/Makefile
  3. 56 46
      api/linux/Makefile
  4. 56 46
      api/test/Makefile
  5. 56 46
      api/win32/Makefile
  6. 1 5
      compiler/Makefile
  7. 60 50
      compiler/new/Makefile
  8. 39 39
      fcl/Makefile
  9. 55 45
      fcl/db/Makefile
  10. 57 47
      fcl/db/interbase/Makefile
  11. 57 47
      fcl/db/tests/Makefile
  12. 56 46
      fcl/go32v2/Makefile
  13. 56 46
      fcl/linux/Makefile
  14. 56 46
      fcl/os2/Makefile
  15. 55 45
      fcl/shedit/Makefile
  16. 56 46
      fcl/shedit/gtk/Makefile
  17. 56 46
      fcl/win32/Makefile
  18. 55 45
      fcl/xml/Makefile
  19. 39 39
      ide/Makefile
  20. 23 23
      ide/fake/Makefile
  21. 56 46
      ide/fake/compiler/Makefile
  22. 56 46
      ide/fake/gdb/Makefile
  23. 57 47
      ide/text/Makefile
  24. 56 46
      install/demo/Makefile
  25. 56 46
      install/demo/graph/Makefile
  26. 56 46
      install/demo/linux/Makefile
  27. 56 46
      install/demo/modex/Makefile
  28. 56 46
      install/demo/text/Makefile
  29. 56 46
      install/demo/win32/Makefile
  30. 56 46
      install/fpinst/Makefile
  31. 39 39
      packages/Makefile
  32. 56 46
      packages/cmem/Makefile
  33. 56 46
      packages/forms/Makefile
  34. 57 47
      packages/forms/demo/Makefile
  35. 57 47
      packages/gdbint/Makefile
  36. 23 23
      packages/gdbint/libgdb/Makefile
  37. 56 46
      packages/ggi/Makefile
  38. 56 46
      packages/gtk/Makefile
  39. 57 47
      packages/gtk/examples/Makefile
  40. 58 48
      packages/gtk/examples/tutorial/Makefile
  41. 56 46
      packages/ibase/Makefile
  42. 56 46
      packages/inet/Makefile
  43. 56 46
      packages/mysql/Makefile
  44. 56 46
      packages/ncurses/Makefile
  45. 55 45
      packages/opengl/Makefile
  46. 55 45
      packages/opengl/build/Makefile
  47. 57 47
      packages/opengl/examples/Makefile
  48. 56 46
      packages/opengl/gtkgl/Makefile
  49. 55 45
      packages/opengl/linux/Makefile
  50. 55 45
      packages/opengl/win32/Makefile
  51. 56 46
      packages/paszlib/Makefile
  52. 56 46
      packages/postgres/Makefile
  53. 56 46
      packages/regexpr/Makefile
  54. 56 46
      packages/svgalib/Makefile
  55. 56 46
      packages/syslog/Makefile
  56. 56 46
      packages/uncgi/Makefile
  57. 56 46
      packages/utmp/Makefile
  58. 56 46
      packages/x11/Makefile
  59. 56 46
      packages/zip/Makefile
  60. 56 46
      packages/zlib/Makefile
  61. 39 39
      rtl/Makefile
  62. 248 98
      rtl/freebsd/Makefile
  63. 56 46
      rtl/go32v1/Makefile
  64. 55 45
      rtl/go32v2/Makefile
  65. 248 98
      rtl/linux/Makefile
  66. 59 49
      rtl/os2/Makefile
  67. 55 45
      rtl/win32/Makefile
  68. 33 23
      tests/Makefile
  69. 56 46
      tests/units/Makefile
  70. 57 47
      utils/Makefile
  71. 56 46
      utils/fprcp/Makefile
  72. 56 46
      utils/h2pas/Makefile
  73. 56 46
      utils/simulator/Makefile
  74. 1 5
      utils/tply/Makefile

+ 39 - 39
api/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -191,7 +183,7 @@ ZIPTARGET=install
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -232,7 +224,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -241,7 +233,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -250,7 +242,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -274,7 +266,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -285,7 +277,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -293,7 +285,7 @@ endif
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -307,7 +299,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -330,9 +322,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -352,7 +352,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -361,7 +361,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -378,7 +378,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -387,7 +387,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -399,7 +399,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -409,7 +409,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -433,7 +433,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -550,7 +550,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -566,7 +566,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 56 - 46
api/go32v2/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -157,7 +149,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -242,7 +234,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -283,7 +275,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -292,7 +284,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -301,7 +293,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -325,7 +317,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -336,7 +328,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -344,7 +336,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -355,7 +347,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -374,7 +366,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -388,7 +380,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -402,7 +394,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -425,6 +417,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -453,9 +446,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -556,9 +558,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -578,7 +588,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -587,7 +597,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -604,7 +614,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -613,7 +623,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -625,7 +635,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -635,7 +645,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -659,7 +669,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -922,7 +932,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -967,7 +977,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -995,7 +1005,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1056,7 +1066,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1072,7 +1082,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1150,7 +1160,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
api/linux/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -157,7 +149,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -243,7 +235,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -284,7 +276,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -293,7 +285,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -302,7 +294,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -326,7 +318,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -337,7 +329,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -345,7 +337,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -356,7 +348,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -375,7 +367,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -389,7 +381,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -403,7 +395,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -426,6 +418,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -454,9 +447,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -557,9 +559,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -579,7 +589,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -588,7 +598,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -605,7 +615,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -614,7 +624,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -626,7 +636,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -636,7 +646,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -660,7 +670,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -923,7 +933,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -968,7 +978,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -996,7 +1006,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1057,7 +1067,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1073,7 +1083,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1151,7 +1161,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
api/test/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -221,7 +213,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -262,7 +254,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -271,7 +263,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -280,7 +272,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -304,7 +296,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -315,7 +307,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -323,7 +315,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -334,7 +326,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -353,7 +345,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -367,7 +359,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -381,7 +373,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -404,6 +396,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -432,9 +425,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -565,9 +567,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -587,7 +597,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -596,7 +606,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -613,7 +623,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -622,7 +632,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -634,7 +644,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -644,7 +654,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -668,7 +678,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -929,7 +939,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -974,7 +984,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1002,7 +1012,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1063,7 +1073,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1079,7 +1089,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1157,7 +1167,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
api/win32/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -157,7 +149,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -242,7 +234,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -283,7 +275,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -292,7 +284,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -301,7 +293,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -325,7 +317,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -336,7 +328,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -344,7 +336,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -355,7 +347,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -374,7 +366,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -388,7 +380,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -402,7 +394,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -425,6 +417,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -453,9 +446,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -556,9 +558,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -578,7 +588,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -587,7 +597,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -604,7 +614,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -613,7 +623,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -625,7 +635,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -635,7 +645,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -659,7 +669,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -922,7 +932,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -967,7 +977,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -995,7 +1005,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1056,7 +1066,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1072,7 +1082,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1150,7 +1160,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 1 - 5
compiler/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/16]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -72,13 +72,9 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
 override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
 override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
 override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 

+ 60 - 50
compiler/new/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -207,7 +199,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -314,7 +306,7 @@ override FPCOPT+=$(LOCALOPT)
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -355,7 +347,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -364,7 +356,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -373,7 +365,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -397,7 +389,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -408,7 +400,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -416,7 +408,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -427,7 +419,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -446,7 +438,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -460,7 +452,7 @@ export UPXPROG
 
 
 # cmp
 # cmp
 ifndef CMP
 ifndef CMP
-CMP:=$(strip $(wildcard $(addsuffix /cmp$(EXEEXT),$(SEARCHPATH))))
+CMP:=$(strip $(wildcard $(addsuffix /cmp$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(CMP),)
 ifeq ($(CMP),)
 CMP=
 CMP=
 else
 else
@@ -471,7 +463,7 @@ export CMP
 
 
 # diff
 # diff
 ifndef DIFF
 ifndef DIFF
-DIFF:=$(strip $(wildcard $(addsuffix /diff$(EXEEXT),$(SEARCHPATH))))
+DIFF:=$(strip $(wildcard $(addsuffix /diff$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(DIFF),)
 ifeq ($(DIFF),)
 DIFF=
 DIFF=
 else
 else
@@ -482,9 +474,9 @@ export DIFF
 
 
 # gdate/date
 # gdate/date
 ifndef DATE
 ifndef DATE
-DATE:=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH))))
+DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(DATE),)
 ifeq ($(DATE),)
-DATE:=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEACHPATH))))
 ifeq ($(DATE),)
 ifeq ($(DATE),)
 DATE=
 DATE=
 else
 else
@@ -504,7 +496,7 @@ endif
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -518,7 +510,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -541,6 +533,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -569,9 +562,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -672,9 +674,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -694,7 +704,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -703,7 +713,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -720,7 +730,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -729,7 +739,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -741,7 +751,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -751,7 +761,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -775,7 +785,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -1020,7 +1030,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1065,7 +1075,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1093,7 +1103,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1154,7 +1164,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1170,7 +1180,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1248,7 +1258,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 39 - 39
fcl/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -191,7 +183,7 @@ ZIPTARGET=install
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -232,7 +224,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -241,7 +233,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -250,7 +242,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -274,7 +266,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -285,7 +277,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -293,7 +285,7 @@ endif
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -307,7 +299,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -330,9 +322,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -352,7 +352,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -361,7 +361,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -378,7 +378,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -387,7 +387,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -399,7 +399,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -409,7 +409,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -433,7 +433,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -550,7 +550,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -566,7 +566,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 55 - 45
fcl/db/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -225,7 +217,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -266,7 +258,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -275,7 +267,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -284,7 +276,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -308,7 +300,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -319,7 +311,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -327,7 +319,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -338,7 +330,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -357,7 +349,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -371,7 +363,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -385,7 +377,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -408,6 +400,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -436,9 +429,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -569,9 +571,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -591,7 +601,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -600,7 +610,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -617,7 +627,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -626,7 +636,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -638,7 +648,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -648,7 +658,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -672,7 +682,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -956,7 +966,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1001,7 +1011,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1029,7 +1039,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1090,7 +1100,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1106,7 +1116,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 57 - 47
fcl/db/interbase/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -147,7 +139,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -231,7 +223,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -272,7 +264,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -281,7 +273,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -290,7 +282,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -314,7 +306,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -325,7 +317,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -333,7 +325,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -344,7 +336,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -363,7 +355,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -377,7 +369,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -391,7 +383,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -414,6 +406,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -442,9 +435,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -605,9 +607,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -622,7 +632,7 @@ endif
 export DESTZIPDIR
 export DESTZIPDIR
 
 
 # On linux, try to find where libgcc.a is.
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
 endif
@@ -635,7 +645,7 @@ export GCCLIBDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -644,7 +654,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -661,7 +671,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -670,7 +680,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -682,7 +692,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -692,7 +702,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -716,7 +726,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -1000,7 +1010,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1045,7 +1055,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1073,7 +1083,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1134,7 +1144,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1150,7 +1160,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1228,7 +1238,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 47
fcl/db/tests/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -594,9 +596,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -611,7 +621,7 @@ endif
 export DESTZIPDIR
 export DESTZIPDIR
 
 
 # On linux, try to find where libgcc.a is.
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
 endif
@@ -624,7 +634,7 @@ export GCCLIBDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -633,7 +643,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -650,7 +660,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -659,7 +669,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -671,7 +681,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -681,7 +691,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -705,7 +715,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -975,7 +985,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1020,7 +1030,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1048,7 +1058,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1109,7 +1119,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1125,7 +1135,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1203,7 +1213,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
fcl/go32v2/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -157,7 +149,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -245,7 +237,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -286,7 +278,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -295,7 +287,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -304,7 +296,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -328,7 +320,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -339,7 +331,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -347,7 +339,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -358,7 +350,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -377,7 +369,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -391,7 +383,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -405,7 +397,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -428,6 +420,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -456,9 +449,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -589,9 +591,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -611,7 +621,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -620,7 +630,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -637,7 +647,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -646,7 +656,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -658,7 +668,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -668,7 +678,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -692,7 +702,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -971,7 +981,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1016,7 +1026,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1044,7 +1054,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1105,7 +1115,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1121,7 +1131,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1199,7 +1209,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
fcl/linux/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -157,7 +149,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -246,7 +238,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -287,7 +279,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -296,7 +288,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -305,7 +297,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -329,7 +321,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -340,7 +332,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -348,7 +340,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -359,7 +351,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -378,7 +370,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -392,7 +384,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -406,7 +398,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -429,6 +421,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -457,9 +450,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -620,9 +622,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -642,7 +652,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -651,7 +661,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -668,7 +678,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -677,7 +687,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -689,7 +699,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -699,7 +709,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -723,7 +733,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -1002,7 +1012,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1047,7 +1057,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1075,7 +1085,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1136,7 +1146,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1152,7 +1162,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1230,7 +1240,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
fcl/os2/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -157,7 +149,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -244,7 +236,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -285,7 +277,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -294,7 +286,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -303,7 +295,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -327,7 +319,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -338,7 +330,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -346,7 +338,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -357,7 +349,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -376,7 +368,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -390,7 +382,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -404,7 +396,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -427,6 +419,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -455,9 +448,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -588,9 +590,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -610,7 +620,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -619,7 +629,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -636,7 +646,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -645,7 +655,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -657,7 +667,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -667,7 +677,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -691,7 +701,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -960,7 +970,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1005,7 +1015,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1033,7 +1043,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1094,7 +1104,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1110,7 +1120,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1188,7 +1198,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 55 - 45
fcl/shedit/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -224,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -265,7 +257,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -274,7 +266,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -283,7 +275,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -307,7 +299,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -318,7 +310,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -326,7 +318,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -337,7 +329,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -356,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -370,7 +362,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -384,7 +376,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -407,6 +399,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -435,9 +428,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -538,9 +540,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -560,7 +570,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -569,7 +579,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -586,7 +596,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -595,7 +605,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -607,7 +617,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -617,7 +627,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -641,7 +651,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -903,7 +913,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -948,7 +958,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -976,7 +986,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1037,7 +1047,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1053,7 +1063,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 56 - 46
fcl/shedit/gtk/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -219,7 +211,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -260,7 +252,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -269,7 +261,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -278,7 +270,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +294,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -313,7 +305,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -321,7 +313,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -332,7 +324,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -351,7 +343,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -365,7 +357,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -379,7 +371,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -402,6 +394,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -430,9 +423,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -593,9 +595,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -615,7 +625,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -624,7 +634,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -641,7 +651,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -650,7 +660,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -662,7 +672,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -672,7 +682,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -696,7 +706,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -971,7 +981,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1016,7 +1026,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1044,7 +1054,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1105,7 +1115,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1121,7 +1131,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1199,7 +1209,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
fcl/win32/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -157,7 +149,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -245,7 +237,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -286,7 +278,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -295,7 +287,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -304,7 +296,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -328,7 +320,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -339,7 +331,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -347,7 +339,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -358,7 +350,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -377,7 +369,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -391,7 +383,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -405,7 +397,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -428,6 +420,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -456,9 +449,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -589,9 +591,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -611,7 +621,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -620,7 +630,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -637,7 +647,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -646,7 +656,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -658,7 +668,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -668,7 +678,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -692,7 +702,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -971,7 +981,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1016,7 +1026,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1044,7 +1054,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1105,7 +1115,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1121,7 +1131,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1199,7 +1209,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 55 - 45
fcl/xml/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -224,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -265,7 +257,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -274,7 +266,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -283,7 +275,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -307,7 +299,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -318,7 +310,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -326,7 +318,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -337,7 +329,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -356,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -370,7 +362,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -384,7 +376,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -407,6 +399,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -435,9 +428,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -538,9 +540,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -560,7 +570,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -569,7 +579,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -586,7 +596,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -595,7 +605,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -607,7 +617,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -617,7 +627,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -641,7 +651,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -903,7 +913,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -948,7 +958,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -976,7 +986,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1037,7 +1047,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1053,7 +1063,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 39 - 39
ide/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -189,7 +181,7 @@ ZIPTARGET=install
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -230,7 +222,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -239,7 +231,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -248,7 +240,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -272,7 +264,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -283,7 +275,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -291,7 +283,7 @@ endif
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -305,7 +297,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -328,9 +320,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -350,7 +350,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -359,7 +359,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -376,7 +376,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -385,7 +385,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -397,7 +397,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -407,7 +407,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -431,7 +431,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -502,7 +502,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -518,7 +518,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 23 - 23
ide/fake/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -186,9 +178,17 @@ ZIPTARGET=install
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -211,7 +211,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max

+ 56 - 46
ide/fake/compiler/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -208,7 +200,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -249,7 +241,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -258,7 +250,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -267,7 +259,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -291,7 +283,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -302,7 +294,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -310,7 +302,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -321,7 +313,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -340,7 +332,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -354,7 +346,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -368,7 +360,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -391,6 +383,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -419,9 +412,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -522,9 +524,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -544,7 +554,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -553,7 +563,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -570,7 +580,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -579,7 +589,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -591,7 +601,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -601,7 +611,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -625,7 +635,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -883,7 +893,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -928,7 +938,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -956,7 +966,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1017,7 +1027,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1033,7 +1043,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1111,7 +1121,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
ide/fake/gdb/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -208,7 +200,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -249,7 +241,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -258,7 +250,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -267,7 +259,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -291,7 +283,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -302,7 +294,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -310,7 +302,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -321,7 +313,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -340,7 +332,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -354,7 +346,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -368,7 +360,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -391,6 +383,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -419,9 +412,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -522,9 +524,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -544,7 +554,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -553,7 +563,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -570,7 +580,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -579,7 +589,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -591,7 +601,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -601,7 +611,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -625,7 +635,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -883,7 +893,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -928,7 +938,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -956,7 +966,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1017,7 +1027,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1033,7 +1043,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1111,7 +1121,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 47
ide/text/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -266,7 +258,7 @@ endif
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -307,7 +299,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -316,7 +308,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -325,7 +317,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -349,7 +341,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -360,7 +352,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -368,7 +360,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -379,7 +371,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -398,7 +390,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -412,7 +404,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -426,7 +418,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -449,6 +441,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -477,9 +470,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -670,9 +672,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -687,7 +697,7 @@ endif
 export DESTZIPDIR
 export DESTZIPDIR
 
 
 # On linux, try to find where libgcc.a is.
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
 endif
@@ -700,7 +710,7 @@ export GCCLIBDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -709,7 +719,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -726,7 +736,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -735,7 +745,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -747,7 +757,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -757,7 +767,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -781,7 +791,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -1055,7 +1065,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1100,7 +1110,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1128,7 +1138,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1189,7 +1199,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1205,7 +1215,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1283,7 +1293,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
install/demo/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -211,7 +203,7 @@ endif
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -252,7 +244,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -261,7 +253,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -294,7 +286,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -305,7 +297,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -313,7 +305,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -324,7 +316,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -343,7 +335,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -357,7 +349,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -371,7 +363,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -394,6 +386,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -422,9 +415,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -476,9 +478,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -498,7 +508,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -507,7 +517,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -524,7 +534,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -533,7 +543,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -545,7 +555,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -555,7 +565,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -579,7 +589,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -819,7 +829,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -864,7 +874,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -892,7 +902,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -953,7 +963,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -969,7 +979,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1047,7 +1057,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
install/demo/graph/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -231,7 +223,7 @@ endif
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -272,7 +264,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -281,7 +273,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -290,7 +282,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -314,7 +306,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -325,7 +317,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -333,7 +325,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -344,7 +336,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -363,7 +355,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -377,7 +369,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -391,7 +383,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -414,6 +406,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -442,9 +435,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -575,9 +577,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -597,7 +607,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -606,7 +616,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -623,7 +633,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -632,7 +642,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -644,7 +654,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -654,7 +664,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -678,7 +688,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -949,7 +959,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -994,7 +1004,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1022,7 +1032,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1083,7 +1093,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1099,7 +1109,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1177,7 +1187,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
install/demo/linux/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -223,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -264,7 +256,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -273,7 +265,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -282,7 +274,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -306,7 +298,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -317,7 +309,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -325,7 +317,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -336,7 +328,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -355,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -369,7 +361,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -383,7 +375,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -406,6 +398,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -434,9 +427,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -537,9 +539,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -559,7 +569,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -568,7 +578,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -585,7 +595,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -594,7 +604,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -606,7 +616,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -616,7 +626,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -640,7 +650,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -901,7 +911,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -946,7 +956,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -974,7 +984,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1035,7 +1045,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1051,7 +1061,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1129,7 +1139,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
install/demo/modex/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -223,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -264,7 +256,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -273,7 +265,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -282,7 +274,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -306,7 +298,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -317,7 +309,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -325,7 +317,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -336,7 +328,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -355,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -369,7 +361,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -383,7 +375,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -406,6 +398,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -434,9 +427,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -537,9 +539,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -559,7 +569,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -568,7 +578,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -585,7 +595,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -594,7 +604,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -606,7 +616,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -616,7 +626,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -640,7 +650,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -901,7 +911,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -946,7 +956,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -974,7 +984,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1035,7 +1045,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1051,7 +1061,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1129,7 +1139,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
install/demo/text/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -221,7 +213,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -262,7 +254,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -271,7 +263,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -280,7 +272,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -304,7 +296,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -315,7 +307,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -323,7 +315,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -334,7 +326,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -353,7 +345,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -367,7 +359,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -381,7 +373,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -404,6 +396,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -432,9 +425,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -535,9 +537,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -557,7 +567,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -566,7 +576,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -583,7 +593,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -592,7 +602,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -604,7 +614,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -614,7 +624,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -638,7 +648,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -899,7 +909,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -944,7 +954,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -972,7 +982,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1033,7 +1043,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1049,7 +1059,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1127,7 +1137,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
install/demo/win32/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -223,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -264,7 +256,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -273,7 +265,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -282,7 +274,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -306,7 +298,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -317,7 +309,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -325,7 +317,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -336,7 +328,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -355,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -369,7 +361,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -383,7 +375,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -406,6 +398,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -434,9 +427,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -537,9 +539,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -559,7 +569,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -568,7 +578,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -585,7 +595,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -594,7 +604,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -606,7 +616,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -616,7 +626,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -640,7 +650,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -901,7 +911,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -946,7 +956,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -974,7 +984,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1035,7 +1045,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1051,7 +1061,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1129,7 +1139,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
install/fpinst/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -240,7 +232,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -281,7 +273,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -290,7 +282,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -299,7 +291,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -323,7 +315,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -334,7 +326,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -342,7 +334,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -353,7 +345,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -372,7 +364,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -386,7 +378,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -400,7 +392,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -423,6 +415,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -451,9 +444,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -614,9 +616,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -636,7 +646,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -645,7 +655,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -662,7 +672,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -671,7 +681,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -683,7 +693,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -693,7 +703,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -717,7 +727,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -978,7 +988,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1023,7 +1033,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1112,7 +1122,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1128,7 +1138,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1206,7 +1216,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 39 - 39
packages/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -197,7 +189,7 @@ ZIPTARGET=install
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -238,7 +230,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -247,7 +239,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -256,7 +248,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -280,7 +272,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -291,7 +283,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -299,7 +291,7 @@ endif
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -313,7 +305,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -737,9 +729,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -759,7 +759,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -768,7 +768,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -785,7 +785,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -794,7 +794,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -806,7 +806,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -816,7 +816,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -840,7 +840,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -939,7 +939,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -955,7 +955,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 56 - 46
packages/cmem/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/forms/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -221,7 +213,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -262,7 +254,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -271,7 +263,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -280,7 +272,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -304,7 +296,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -315,7 +307,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -323,7 +315,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -334,7 +326,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -353,7 +345,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -367,7 +359,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -381,7 +373,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -404,6 +396,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -432,9 +425,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -565,9 +567,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -587,7 +597,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -596,7 +606,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -613,7 +623,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -622,7 +632,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -634,7 +644,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -644,7 +654,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -668,7 +678,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -965,7 +975,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1010,7 +1020,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1038,7 +1048,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1099,7 +1109,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1115,7 +1125,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1193,7 +1203,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 47
packages/forms/demo/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -219,7 +211,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -260,7 +252,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -269,7 +261,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -278,7 +270,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +294,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -313,7 +305,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -321,7 +313,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -332,7 +324,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -351,7 +343,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -365,7 +357,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -379,7 +371,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -402,6 +394,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -430,9 +423,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -593,9 +595,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -610,7 +620,7 @@ endif
 export DESTZIPDIR
 export DESTZIPDIR
 
 
 # Where to find other libraries
 # Where to find other libraries
-ifdef inlinux
+ifdef inUnix
 ifndef OTHERLIBDIR
 ifndef OTHERLIBDIR
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 endif
 endif
@@ -623,7 +633,7 @@ export OTHERLIBDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -632,7 +642,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -649,7 +659,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -658,7 +668,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -670,7 +680,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -680,7 +690,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -704,7 +714,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -970,7 +980,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1015,7 +1025,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1043,7 +1053,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1104,7 +1114,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1120,7 +1130,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1198,7 +1208,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 47
packages/gdbint/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -226,7 +218,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -267,7 +259,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -276,7 +268,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -285,7 +277,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -309,7 +301,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -320,7 +312,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -328,7 +320,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -339,7 +331,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -358,7 +350,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -372,7 +364,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -386,7 +378,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -409,6 +401,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -437,9 +430,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -540,9 +542,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -557,7 +567,7 @@ endif
 export DESTZIPDIR
 export DESTZIPDIR
 
 
 # On linux, try to find where libgcc.a is.
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
 endif
@@ -570,7 +580,7 @@ export GCCLIBDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -579,7 +589,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -596,7 +606,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -605,7 +615,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -617,7 +627,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -627,7 +637,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -651,7 +661,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -942,7 +952,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -987,7 +997,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1015,7 +1025,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1076,7 +1086,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1092,7 +1102,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1170,7 +1180,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 23 - 23
packages/gdbint/libgdb/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -185,9 +177,17 @@ ZIPTARGET=install
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -210,7 +210,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max

+ 56 - 46
packages/ggi/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/gtk/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -226,7 +218,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -267,7 +259,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -276,7 +268,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -285,7 +277,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -309,7 +301,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -320,7 +312,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -328,7 +320,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -339,7 +331,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -358,7 +350,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -372,7 +364,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -386,7 +378,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -409,6 +401,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -437,9 +430,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -540,9 +542,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -562,7 +572,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -571,7 +581,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -588,7 +598,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -597,7 +607,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -609,7 +619,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -619,7 +629,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -643,7 +653,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -923,7 +933,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -968,7 +978,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -996,7 +1006,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1057,7 +1067,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1073,7 +1083,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1151,7 +1161,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 47
packages/gtk/examples/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -225,7 +217,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -266,7 +258,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -275,7 +267,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -284,7 +276,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -308,7 +300,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -319,7 +311,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -327,7 +319,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -338,7 +330,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -357,7 +349,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -371,7 +363,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -385,7 +377,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -408,6 +400,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -436,9 +429,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -569,9 +571,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -586,7 +596,7 @@ endif
 export DESTZIPDIR
 export DESTZIPDIR
 
 
 # On linux, try to find where libgcc.a is.
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
 endif
@@ -594,7 +604,7 @@ endif
 export GCCLIBDIR
 export GCCLIBDIR
 
 
 # Where to find other libraries
 # Where to find other libraries
-ifdef inlinux
+ifdef inUnix
 ifndef OTHERLIBDIR
 ifndef OTHERLIBDIR
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 endif
 endif
@@ -607,7 +617,7 @@ export OTHERLIBDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -616,7 +626,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -633,7 +643,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -642,7 +652,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -654,7 +664,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -664,7 +674,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -688,7 +698,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -961,7 +971,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1006,7 +1016,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1034,7 +1044,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1095,7 +1105,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1111,7 +1121,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 58 - 48
packages/gtk/examples/tutorial/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -223,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -264,7 +256,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -273,7 +265,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -282,7 +274,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -306,7 +298,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -317,7 +309,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -325,7 +317,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -336,7 +328,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -355,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -369,7 +361,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -383,7 +375,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -406,6 +398,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -434,9 +427,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -567,9 +569,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -584,7 +594,7 @@ endif
 export DESTZIPDIR
 export DESTZIPDIR
 
 
 # On linux, try to find where libgcc.a is.
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
 endif
@@ -592,7 +602,7 @@ endif
 export GCCLIBDIR
 export GCCLIBDIR
 
 
 # Where to find other libraries
 # Where to find other libraries
-ifdef inlinux
+ifdef inUnix
 ifndef OTHERLIBDIR
 ifndef OTHERLIBDIR
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 endif
 endif
@@ -605,7 +615,7 @@ export OTHERLIBDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -614,7 +624,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -631,7 +641,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -640,7 +650,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -652,7 +662,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -662,7 +672,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -686,7 +696,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -957,7 +967,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1002,7 +1012,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1030,7 +1040,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1091,7 +1101,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1107,7 +1117,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1185,7 +1195,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/ibase/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/inet/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/mysql/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/ncurses/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 55 - 45
packages/opengl/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -200,7 +192,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -241,7 +233,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -250,7 +242,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -259,7 +251,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -283,7 +275,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -294,7 +286,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -302,7 +294,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -313,7 +305,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -332,7 +324,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -346,7 +338,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -360,7 +352,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -383,6 +375,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -411,9 +404,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -465,9 +467,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -487,7 +497,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -496,7 +506,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -513,7 +523,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -522,7 +532,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -534,7 +544,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -544,7 +554,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -568,7 +578,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -832,7 +842,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -877,7 +887,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -905,7 +915,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -966,7 +976,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -982,7 +992,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 55 - 45
packages/opengl/build/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all_units
 defaultrule: all_units
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -219,7 +211,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -260,7 +252,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -269,7 +261,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -278,7 +270,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +294,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -313,7 +305,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -321,7 +313,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -332,7 +324,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -351,7 +343,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -365,7 +357,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -379,7 +371,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -402,6 +394,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -430,9 +423,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -563,9 +565,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -585,7 +595,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -594,7 +604,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -611,7 +621,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -620,7 +630,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -632,7 +642,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -642,7 +652,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -666,7 +676,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -941,7 +951,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -986,7 +996,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1014,7 +1024,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1075,7 +1085,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1091,7 +1101,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 57 - 47
packages/opengl/examples/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -223,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -264,7 +256,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -273,7 +265,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -282,7 +274,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -306,7 +298,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -317,7 +309,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -325,7 +317,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -336,7 +328,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -355,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -369,7 +361,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -383,7 +375,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -406,6 +398,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -434,9 +427,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -599,9 +601,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -616,7 +626,7 @@ endif
 export DESTZIPDIR
 export DESTZIPDIR
 
 
 # On linux, try to find where libgcc.a is.
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
 endif
@@ -624,7 +634,7 @@ endif
 export GCCLIBDIR
 export GCCLIBDIR
 
 
 # Where to find other libraries
 # Where to find other libraries
-ifdef inlinux
+ifdef inUnix
 ifndef OTHERLIBDIR
 ifndef OTHERLIBDIR
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 endif
 endif
@@ -637,7 +647,7 @@ export OTHERLIBDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -646,7 +656,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -663,7 +673,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -672,7 +682,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -684,7 +694,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -694,7 +704,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -718,7 +728,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -989,7 +999,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1034,7 +1044,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1062,7 +1072,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1123,7 +1133,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1139,7 +1149,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 56 - 46
packages/opengl/gtkgl/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -223,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -264,7 +256,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -273,7 +265,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -282,7 +274,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -306,7 +298,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -317,7 +309,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -325,7 +317,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -336,7 +328,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -355,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -369,7 +361,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -383,7 +375,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -406,6 +398,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -434,9 +427,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -629,9 +631,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -646,7 +656,7 @@ endif
 export DESTZIPDIR
 export DESTZIPDIR
 
 
 # Where to find other libraries
 # Where to find other libraries
-ifdef inlinux
+ifdef inUnix
 ifndef OTHERLIBDIR
 ifndef OTHERLIBDIR
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 endif
 endif
@@ -659,7 +669,7 @@ export OTHERLIBDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -668,7 +678,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -685,7 +695,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -694,7 +704,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -706,7 +716,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -716,7 +726,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -740,7 +750,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -1025,7 +1035,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1070,7 +1080,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1098,7 +1108,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1159,7 +1169,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1175,7 +1185,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 55 - 45
packages/opengl/linux/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -147,7 +139,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -224,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -265,7 +257,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -274,7 +266,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -283,7 +275,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -307,7 +299,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -318,7 +310,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -326,7 +318,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -337,7 +329,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -356,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -370,7 +362,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -384,7 +376,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -407,6 +399,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -435,9 +428,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -568,9 +570,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -590,7 +600,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -599,7 +609,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -616,7 +626,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -625,7 +635,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -637,7 +647,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -647,7 +657,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -671,7 +681,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -929,7 +939,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -974,7 +984,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1002,7 +1012,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1063,7 +1073,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1079,7 +1089,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 55 - 45
packages/opengl/win32/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -82,15 +78,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -147,7 +139,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -224,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -265,7 +257,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -274,7 +266,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -283,7 +275,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -307,7 +299,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -318,7 +310,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -326,7 +318,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -337,7 +329,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -356,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -370,7 +362,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -384,7 +376,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -407,6 +399,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -435,9 +428,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -568,9 +570,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -590,7 +600,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -599,7 +609,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -616,7 +626,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -625,7 +635,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -637,7 +647,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -647,7 +657,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -671,7 +681,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -929,7 +939,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -974,7 +984,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1002,7 +1012,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1063,7 +1073,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1079,7 +1089,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 56 - 46
packages/paszlib/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -221,7 +213,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -262,7 +254,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -271,7 +263,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -280,7 +272,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -304,7 +296,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -315,7 +307,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -323,7 +315,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -334,7 +326,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -353,7 +345,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -367,7 +359,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -381,7 +373,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -404,6 +396,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -432,9 +425,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -535,9 +537,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -557,7 +567,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -566,7 +576,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -583,7 +593,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -592,7 +602,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -604,7 +614,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -614,7 +624,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -638,7 +648,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -918,7 +928,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -963,7 +973,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -991,7 +1001,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1052,7 +1062,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1068,7 +1078,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1146,7 +1156,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/postgres/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/regexpr/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -221,7 +213,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -262,7 +254,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -271,7 +263,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -280,7 +272,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -304,7 +296,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -315,7 +307,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -323,7 +315,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -334,7 +326,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -353,7 +345,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -367,7 +359,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -381,7 +373,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -404,6 +396,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -432,9 +425,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -535,9 +537,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -557,7 +567,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -566,7 +576,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -583,7 +593,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -592,7 +602,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -604,7 +614,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -614,7 +624,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -638,7 +648,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -922,7 +932,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -967,7 +977,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -995,7 +1005,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1056,7 +1066,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1072,7 +1082,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1150,7 +1160,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/svgalib/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/syslog/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/uncgi/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -915,7 +925,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -960,7 +970,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -988,7 +998,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1049,7 +1059,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1065,7 +1075,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1143,7 +1153,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/utmp/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -917,7 +927,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -962,7 +972,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -990,7 +1000,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1051,7 +1061,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1077,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1145,7 +1155,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/x11/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -218,7 +210,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -259,7 +251,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -268,7 +260,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -277,7 +269,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -301,7 +293,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -312,7 +304,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -320,7 +312,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -331,7 +323,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -350,7 +342,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -364,7 +356,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -378,7 +370,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -401,6 +393,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -429,9 +422,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -532,9 +534,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -554,7 +564,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -563,7 +573,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -580,7 +590,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -589,7 +599,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -601,7 +611,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -611,7 +621,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -635,7 +645,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -893,7 +903,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -938,7 +948,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -966,7 +976,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1027,7 +1037,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1043,7 +1053,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1121,7 +1131,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/zip/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -221,7 +213,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -262,7 +254,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -271,7 +263,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -280,7 +272,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -304,7 +296,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -315,7 +307,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -323,7 +315,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -334,7 +326,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -353,7 +345,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -367,7 +359,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -381,7 +373,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -404,6 +396,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -432,9 +425,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -535,9 +537,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -557,7 +567,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -566,7 +576,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -583,7 +593,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -592,7 +602,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -604,7 +614,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -614,7 +624,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -638,7 +648,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -896,7 +906,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -941,7 +951,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -969,7 +979,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1030,7 +1040,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1046,7 +1056,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1124,7 +1134,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
packages/zlib/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -218,7 +210,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -259,7 +251,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -268,7 +260,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -277,7 +269,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -301,7 +293,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -312,7 +304,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -320,7 +312,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -331,7 +323,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -350,7 +342,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -364,7 +356,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -378,7 +370,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -401,6 +393,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -429,9 +422,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -532,9 +534,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -554,7 +564,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -563,7 +573,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -580,7 +590,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -589,7 +599,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -601,7 +611,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -611,7 +621,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -635,7 +645,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -893,7 +903,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -938,7 +948,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -966,7 +976,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1027,7 +1037,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1043,7 +1053,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1121,7 +1131,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 39 - 39
rtl/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -189,7 +181,7 @@ ZIPTARGET=install
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -230,7 +222,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -239,7 +231,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -248,7 +240,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -272,7 +264,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -283,7 +275,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -291,7 +283,7 @@ endif
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -305,7 +297,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -328,9 +320,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -350,7 +350,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -359,7 +359,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -376,7 +376,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -385,7 +385,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -397,7 +397,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -407,7 +407,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -431,7 +431,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -504,7 +504,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -520,7 +520,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 248 - 98
rtl/freebsd/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/17]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,13 +79,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2$(EXEEXT)
-else
-FPC=ppc386$(EXEEXT)
-endif
+FPC=ppc386
 endif
 endif
 endif
 endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -151,8 +145,10 @@ endif
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
 ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=wrong
 override FPCDIR=wrong
 endif
 endif
+endif
 else
 else
 override FPCDIR=wrong
 override FPCDIR=wrong
 endif
 endif
@@ -161,16 +157,32 @@ endif
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
 override FPCDIR=.
 override FPCDIR=.
 ifeq ($(wildcard $(FPCDIR)/rtl),)
 ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=wrong
 override FPCDIR=wrong
 endif
 endif
 endif
 endif
+endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
 else
 else
-override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
 endif
 endif
 endif
 endif
 
 
@@ -209,7 +221,8 @@ endif
 # Libraries
 # Libraries
 
 
 LIBNAME=libfprtl.so
 LIBNAME=libfprtl.so
-SHAREDLIBOBJECTUNITS=$(SYSTEMUNIT) objpas strings linux  dos crt objects printer sysutils typinfo math cpu mmx getopts heaptrc errors sockets ipc
+LIBVERSION=1.0
+SHAREDLIBUNITOBJECTS=$(SYSTEMUNIT) objpas strings linux  dos crt objects printer sysutils typinfo math cpu mmx getopts heaptrc errors sockets ipc
 
 
 # Info
 # Info
 
 
@@ -244,7 +257,7 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -285,7 +298,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -294,7 +307,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -303,7 +316,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -327,7 +340,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -337,15 +350,8 @@ PPAS=ppas.bat
 endif
 endif
 endif
 endif
 
 
-# also call ppas if with command option -s
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-EXECPPAS:=@$(PPAS)
-endif
-
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -353,7 +359,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -364,7 +370,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -383,7 +389,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -397,11 +403,11 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
-ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
+ZIPPROG:=$(firstword $(ZIPPROG))
 endif
 endif
 endif
 endif
 export ZIPPROG
 export ZIPPROG
@@ -411,7 +417,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -434,6 +440,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -462,9 +469,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -516,9 +532,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -538,7 +562,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -547,7 +571,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -564,7 +588,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -573,7 +597,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -585,13 +609,26 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 endif
 endif
 
 
+# Where to install the examples, under linux we use the doc dir
+# because the copytree command will create a subdir itself
+ifndef EXAMPLEINSTALLDIR
+ifdef UNIXINSTALLDIR
+EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
+else
+EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
+endif
+ifdef EXAMPLESUBDIR
+EXAMPLEINSTALLDIR:=$(EXAMPLEINSTALLDIR)/$(EXAMPLESUBDIR)
+endif
+endif
+
 # Where the some extra (data)files will be stored
 # Where the some extra (data)files will be stored
 ifndef DATAINSTALLDIR
 ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 DATAINSTALLDIR=$(BASEINSTALLDIR)
@@ -601,13 +638,12 @@ endif
 # Redirection
 # Redirection
 #####################################################################
 #####################################################################
 
 
-# Release ? Then force OPT and don't use extra opts via commandline
 ifndef REDIRFILE
 ifndef REDIRFILE
 REDIRFILE=log
 REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -628,22 +664,27 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 override FPCOPT+=-T$(OS_TARGET)
 endif
 endif
 
 
-ifdef UNITSDIR
-override FPCOPT+=-Fu$(UNITSDIR)
+# User dirs should be first, so they are looked at first
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
 endif
 endif
-
-ifdef NEEDINCDIR
-override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
 endif
 endif
-
-
-# Target dirs
-ifdef TARGETDIR
-override FPCOPT+=-FE$(TARGETDIR)
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
 endif
 endif
 
 
 # Smartlinking
 # Smartlinking
-ifdef SMARTLINK
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+
+# Smartlinking creation
+ifdef CREATESMART
 override FPCOPT+=-CX
 override FPCOPT+=-CX
 endif
 endif
 
 
@@ -653,30 +694,65 @@ override FPCOPT+=-g -dDEBUG
 endif
 endif
 
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
 # Release mode (strip, optimize and don't load ppc386.cfg)
+# 0.99.12b has a bug in the optimizer so don't use it by default
 ifdef RELEASE
 ifdef RELEASE
+ifeq ($(FPC_VERSION),0.99.12)
+override FPCOPT+=-Xs -OGp3 -n
+else
 override FPCOPT+=-Xs -OG2p3 -n
 override FPCOPT+=-Xs -OG2p3 -n
 endif
 endif
+endif
+
+# Strip
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+
+# Optimizer
+ifdef OPTIMIZE
+override FPCOPT+=-OG2p3
+endif
 
 
 # Verbose settings (warning,note,info)
 # Verbose settings (warning,note,info)
 ifdef VERBOSE
 ifdef VERBOSE
 override FPCOPT+=-vwni
 override FPCOPT+=-vwni
 endif
 endif
 
 
-# Add commandline options
-ifdef OPT
-override FPCOPT+=$(OPT)
+ifdef UNITSDIR
+override FPCOPT+=-Fu$(UNITSDIR)
 endif
 endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+
+ifdef NEEDINCDIR
+override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
 endif
 endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+
+
+# Target dirs and the prefix to use for clean/install
+ifdef TARGETDIR
+override FPCOPT+=-FE$(TARGETDIR)
+ifeq ($(TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(TARGETDIR)/
 endif
 endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
 endif
 endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+ifdef UNITTARGETDIR
+override FPCOPT+=-FU$(UNITTARGETDIR)
+ifeq ($(UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(TARGETDIR)/
+endif
+else
+ifdef TARGETDIR
+override UNITTARGETDIR=$(TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+
+# Add commandline options last so they can override
+ifdef OPT
+override FPCOPT+=$(OPT)
 endif
 endif
 
 
 # Add defines from FPCOPTDEF to FPCOPT
 # Add defines from FPCOPTDEF to FPCOPT
@@ -698,11 +774,22 @@ endif
 ifeq ($(OS_SOURCE),win32)
 ifeq ($(OS_SOURCE),win32)
 override FPCEXTCMD:=$(FPCOPT)
 override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
 endif
 endif
 
 
 # Compiler commandline
 # Compiler commandline
 override COMPILER:=$(FPC) $(FPCOPT)
 override COMPILER:=$(FPC) $(FPCOPT)
 
 
+# also call ppas if with command option -s
+# but only if the OS_SOURCE and OS_TARGE are equal
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(OS_SOURCE),$(OS_TARGET))
+EXECPPAS:=@$(PPAS)
+endif
+endif
+
 #####################################################################
 #####################################################################
 # Standard rules
 # Standard rules
 #####################################################################
 #####################################################################
@@ -721,17 +808,23 @@ install: fpc_install
 
 
 sourceinstall: fpc_sourceinstall
 sourceinstall: fpc_sourceinstall
 
 
+exampleinstall: fpc_exampleinstall
+
 zipinstall: fpc_zipinstall
 zipinstall: fpc_zipinstall
 
 
 zipsourceinstall: fpc_zipsourceinstall
 zipsourceinstall: fpc_zipsourceinstall
 
 
+zipexampleinstall: fpc_zipexampleinstall
+
 clean: fpc_clean
 clean: fpc_clean
 
 
+distclean: fpc_distclean
+
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 
 
 info: fpc_info
 info: fpc_info
 
 
-.PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipsourceinstall clean cleanall info
+.PHONY:  all debug smart shared showinstall install sourceinstall exampleinstall zipinstall zipsourceinstall zipexampleinstall clean distclean cleanall info
 
 
 #####################################################################
 #####################################################################
 # Loaders
 # Loaders
@@ -779,9 +872,11 @@ fpc_units: $(UNITPPUFILES)
 # Resource strings
 # Resource strings
 #####################################################################
 #####################################################################
 
 
+ifdef RSTOBJECTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(RSTOBJECTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(RSTOBJECTS))
 
 
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
+endif
 
 
 #####################################################################
 #####################################################################
 # General compile rules
 # General compile rules
@@ -799,25 +894,30 @@ fpc_all: fpc_packages $(FPCMADE)
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
 
 
+# Search paths for .ppu if targetdir is set
+ifdef UNITTARGETDIR
+vpath %$(PPUEXT) $(UNITTARGETDIR)
+endif
+
 # General compile rules, available for both possible PASEXT
 # General compile rules, available for both possible PASEXT
 
 
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
 
 
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+	$(EXECPPAS)
 
 
 %$(PPUEXT): %.pas
 %$(PPUEXT): %.pas
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+	$(EXECPPAS)
 
 
 %$(EXEEXT): %.pp
 %$(EXEEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+	$(EXECPPAS)
 
 
 %$(EXEEXT): %.pas
 %$(EXEEXT): %.pas
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+	$(EXECPPAS)
 
 
 #####################################################################
 #####################################################################
 # Library
 # Library
@@ -825,20 +925,26 @@ fpc_debug:
 
 
 .PHONY: fpc_smart fpc_shared
 .PHONY: fpc_smart fpc_shared
 
 
+ifdef LIBVERSION
+LIBFULLNAME=$(LIBNAME).$(LIBVERSION)
+else
+LIBFULLNAME=$(LIBNAME)
+endif
+
 # Default sharedlib units are all unit objects
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
 SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
 endif
 endif
 
 
 fpc_smart:
 fpc_smart:
-	$(MAKE) all SMARTLINK=1
+	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
-	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
+	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBFULLNAME)
 endif
 endif
 else
 else
 	@$(ECHO) "Shared Libraries not supported"
 	@$(ECHO) "Shared Libraries not supported"
@@ -855,16 +961,17 @@ override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 endif
 
 
 ifdef INSTALLPPUFILES
 ifdef INSTALLPPUFILES
+override INSTALLPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPUFILES))
 ifdef PPUFILES
 ifdef PPUFILES
-ifdef inlinux
 INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
 INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
-INSTALLPPULIBFILES:=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
 else
 else
-INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
 endif
 endif
-else
-INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPULINKFILES))
 endif
 endif
+
+ifdef INSTALLEXEFILES
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
 endif
 endif
 
 
 fpc_showinstall: $(SHOWINSTALLTARGET)
 fpc_showinstall: $(SHOWINSTALLTARGET)
@@ -876,8 +983,11 @@ ifdef INSTALLPPUFILES
 ifneq ($(INSTALLPPULINKFILES),)
 ifneq ($(INSTALLPPULINKFILES),)
 	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
 endif
-ifneq ($(INSTALLPPULIBFILES),)
-	@$(ECHO) -e $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
+ifneq ($(wildcard $(LIBFULLNAME)),)
+	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
+ifdef HASSHAREDLIB
+	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
+endif
 endif
 endif
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
@@ -900,9 +1010,12 @@ ifdef INSTALLPPUFILES
 ifneq ($(INSTALLPPULINKFILES),)
 ifneq ($(INSTALLPPULINKFILES),)
 	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
 	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
 endif
 endif
-ifneq ($(INSTALLPPULIBFILES),)
+ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
-	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
+	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
+ifdef inUnix
+	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
+endif
 endif
 endif
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
@@ -924,6 +1037,24 @@ fpc_sourceinstall: clean
 	$(MKDIR) $(SOURCEINSTALLDIR)
 	$(MKDIR) $(SOURCEINSTALLDIR)
 	$(COPYTREE) $(SOURCETOPDIR) $(SOURCEINSTALLDIR)
 	$(COPYTREE) $(SOURCETOPDIR) $(SOURCEINSTALLDIR)
 
 
+#####################################################################
+# exampleinstall rules
+#####################################################################
+
+.PHONY: fpc_exampleinstall
+
+fpc_exampleinstall: $(addsuffix _clean,$(EXAMPLEDIROBJECTS))
+ifdef EXAMPLESOURCEFILES
+	$(MKDIR) $(EXAMPLEINSTALLDIR)
+	$(COPY) $(EXAMPLESOURCEFILES) $(EXAMPLEINSTALLDIR)
+endif
+ifdef EXAMPLEDIROBJECTS
+ifndef EXAMPLESOURCEFILES
+	$(MKDIR) $(EXAMPLEINSTALLDIR)
+endif
+	$(COPYTREE) $(addsuffix /*,$(EXAMPLEDIROBJECTS)) $(EXAMPLEINSTALLDIR)
+endif
+
 #####################################################################
 #####################################################################
 # Zip
 # Zip
 #####################################################################
 #####################################################################
@@ -943,7 +1074,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -959,7 +1090,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -974,7 +1105,7 @@ ifdef USETAR
 	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
 	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
 	cd $(PACKDIR) ; $(TARPROG) c$(TAROPT) --file $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
 	cd $(PACKDIR) ; $(TARPROG) c$(TAROPT) --file $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
 else
 else
-	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)/$(ZIPEXT)
+	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT)
 	cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR)
 	cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR)
 endif
 endif
 	$(DELTREE) $(PACKDIR)
 	$(DELTREE) $(PACKDIR)
@@ -985,27 +1116,35 @@ endif
 fpc_zipsourceinstall:
 fpc_zipsourceinstall:
 	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall PACKAGESUFFIX=src
 	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall PACKAGESUFFIX=src
 
 
+.PHONY:  fpc_zipexampleinstall
+
+fpc_zipexampleinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall PACKAGESUFFIX=exm
+
 #####################################################################
 #####################################################################
 # Clean rules
 # Clean rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_clean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
 
 
 ifdef EXTRACLEANUNITS
 ifdef EXTRACLEANUNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 endif
 
 
 ifdef CLEANPPUFILES
 ifdef CLEANPPUFILES
+override CLEANPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPUFILES))
+# Get the .o and .a files created for the units
 ifdef PPUFILES
 ifdef PPUFILES
 CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
 CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
 else
 else
-CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
+CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
 endif
 endif
+override CLEANPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPULINKFILES))
 endif
 endif
 
 
 fpc_clean: $(CLEANTARGET)
 fpc_clean: $(CLEANTARGET)
 ifdef CLEANEXEFILES
 ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
+	-$(DEL) $(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
 endif
 endif
 ifdef CLEANPPUFILES
 ifdef CLEANPPUFILES
 	-$(DEL) $(CLEANPPUFILES)
 	-$(DEL) $(CLEANPPUFILES)
@@ -1014,20 +1153,31 @@ ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
 endif
 ifdef CLEANRSTFILES
 ifdef CLEANRSTFILES
-	-$(DEL) $(CLEANRSTFILES)
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
 endif
 endif
 ifdef EXTRACLEANFILES
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 endif
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTCMD) $(REDIRFILE)
+ifdef LIBNAME
+	-$(DEL) $(LIBNAME) $(LIBFULLNAME)
+endif
+	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
+
+fpc_distclean: fpc_clean
+
+# Also run clean first if targetdir is set. Unittargetdir is always
+# set if targetdir or unittargetdir is specified
+ifdef UNITTARGETDIR
+TARGETDIRCLEAN=fpc_clean
+endif
 
 
-fpc_cleanall: $(CLEANTARGET)
+fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 ifdef CLEANEXEFILES
 ifdef CLEANEXEFILES
 	-$(DEL) $(CLEANEXEFILES)
 	-$(DEL) $(CLEANEXEFILES)
 endif
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTCMD) $(REDIRFILE)
+	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
 
 
 #####################################################################
 #####################################################################
 # Info rules
 # Info rules

+ 56 - 46
rtl/go32v1/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,15 +79,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -164,7 +156,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -252,7 +244,7 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -293,7 +285,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -302,7 +294,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -311,7 +303,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -335,7 +327,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -346,7 +338,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -354,7 +346,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -365,7 +357,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -384,7 +376,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -398,7 +390,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -412,7 +404,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -435,6 +427,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -463,9 +456,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -517,9 +519,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -539,7 +549,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -548,7 +558,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -565,7 +575,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -574,7 +584,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -586,7 +596,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -596,7 +606,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -620,7 +630,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -907,7 +917,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -952,7 +962,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -980,7 +990,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1041,7 +1051,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1057,7 +1067,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1135,7 +1145,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 55 - 45
rtl/go32v2/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,15 +79,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -174,7 +166,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -263,7 +255,7 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -304,7 +296,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -313,7 +305,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -322,7 +314,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -346,7 +338,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -357,7 +349,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -365,7 +357,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -376,7 +368,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -395,7 +387,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -409,7 +401,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -423,7 +415,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -446,6 +438,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -474,9 +467,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -528,9 +530,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -550,7 +560,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -559,7 +569,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -576,7 +586,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -585,7 +595,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -597,7 +607,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -607,7 +617,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -631,7 +641,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -928,7 +938,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -973,7 +983,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1001,7 +1011,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1062,7 +1072,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1078,7 +1088,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 248 - 98
rtl/linux/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/17]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,13 +79,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2$(EXEEXT)
-else
-FPC=ppc386$(EXEEXT)
-endif
+FPC=ppc386
 endif
 endif
 endif
 endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -152,8 +146,10 @@ endif
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 ifeq ($(wildcard $(FPCDIR)/rtl),)
 ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=wrong
 override FPCDIR=wrong
 endif
 endif
+endif
 else
 else
 override FPCDIR=wrong
 override FPCDIR=wrong
 endif
 endif
@@ -162,16 +158,32 @@ endif
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
 override FPCDIR=.
 override FPCDIR=.
 ifeq ($(wildcard $(FPCDIR)/rtl),)
 ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=wrong
 override FPCDIR=wrong
 endif
 endif
 endif
 endif
+endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
 else
 else
-override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
 endif
 endif
 endif
 endif
 
 
@@ -210,7 +222,8 @@ endif
 # Libraries
 # Libraries
 
 
 LIBNAME=libfprtl.so
 LIBNAME=libfprtl.so
-SHAREDLIBOBJECTUNITS=$(SYSTEMUNIT) objpas strings linux ports dos crt objects printer sysutils typinfo math cpu mmx getopts heaptrc errors sockets ipc dl dynlibs varutils
+LIBVERSION=1.0
+SHAREDLIBUNITOBJECTS=$(SYSTEMUNIT) objpas strings linux ports dos crt objects printer sysutils typinfo math cpu mmx getopts heaptrc errors sockets ipc dl dynlibs varutils
 
 
 # Info
 # Info
 
 
@@ -245,7 +258,7 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -286,7 +299,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -295,7 +308,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -304,7 +317,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -328,7 +341,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -338,15 +351,8 @@ PPAS=ppas.bat
 endif
 endif
 endif
 endif
 
 
-# also call ppas if with command option -s
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-EXECPPAS:=@$(PPAS)
-endif
-
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -354,7 +360,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -365,7 +371,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -384,7 +390,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -398,11 +404,11 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
-ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
+ZIPPROG:=$(firstword $(ZIPPROG))
 endif
 endif
 endif
 endif
 export ZIPPROG
 export ZIPPROG
@@ -412,7 +418,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -435,6 +441,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -463,9 +470,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -517,9 +533,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -539,7 +563,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -548,7 +572,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -565,7 +589,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -574,7 +598,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -586,13 +610,26 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 endif
 endif
 
 
+# Where to install the examples, under linux we use the doc dir
+# because the copytree command will create a subdir itself
+ifndef EXAMPLEINSTALLDIR
+ifdef UNIXINSTALLDIR
+EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
+else
+EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
+endif
+ifdef EXAMPLESUBDIR
+EXAMPLEINSTALLDIR:=$(EXAMPLEINSTALLDIR)/$(EXAMPLESUBDIR)
+endif
+endif
+
 # Where the some extra (data)files will be stored
 # Where the some extra (data)files will be stored
 ifndef DATAINSTALLDIR
 ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 DATAINSTALLDIR=$(BASEINSTALLDIR)
@@ -602,13 +639,12 @@ endif
 # Redirection
 # Redirection
 #####################################################################
 #####################################################################
 
 
-# Release ? Then force OPT and don't use extra opts via commandline
 ifndef REDIRFILE
 ifndef REDIRFILE
 REDIRFILE=log
 REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -629,22 +665,27 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 override FPCOPT+=-T$(OS_TARGET)
 endif
 endif
 
 
-ifdef UNITSDIR
-override FPCOPT+=-Fu$(UNITSDIR)
+# User dirs should be first, so they are looked at first
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
 endif
 endif
-
-ifdef NEEDINCDIR
-override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
 endif
 endif
-
-
-# Target dirs
-ifdef TARGETDIR
-override FPCOPT+=-FE$(TARGETDIR)
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
 endif
 endif
 
 
 # Smartlinking
 # Smartlinking
-ifdef SMARTLINK
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+
+# Smartlinking creation
+ifdef CREATESMART
 override FPCOPT+=-CX
 override FPCOPT+=-CX
 endif
 endif
 
 
@@ -654,30 +695,65 @@ override FPCOPT+=-g -dDEBUG
 endif
 endif
 
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
 # Release mode (strip, optimize and don't load ppc386.cfg)
+# 0.99.12b has a bug in the optimizer so don't use it by default
 ifdef RELEASE
 ifdef RELEASE
+ifeq ($(FPC_VERSION),0.99.12)
+override FPCOPT+=-Xs -OGp3 -n
+else
 override FPCOPT+=-Xs -OG2p3 -n
 override FPCOPT+=-Xs -OG2p3 -n
 endif
 endif
+endif
+
+# Strip
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+
+# Optimizer
+ifdef OPTIMIZE
+override FPCOPT+=-OG2p3
+endif
 
 
 # Verbose settings (warning,note,info)
 # Verbose settings (warning,note,info)
 ifdef VERBOSE
 ifdef VERBOSE
 override FPCOPT+=-vwni
 override FPCOPT+=-vwni
 endif
 endif
 
 
-# Add commandline options
-ifdef OPT
-override FPCOPT+=$(OPT)
+ifdef UNITSDIR
+override FPCOPT+=-Fu$(UNITSDIR)
 endif
 endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+
+ifdef NEEDINCDIR
+override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
 endif
 endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+
+
+# Target dirs and the prefix to use for clean/install
+ifdef TARGETDIR
+override FPCOPT+=-FE$(TARGETDIR)
+ifeq ($(TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(TARGETDIR)/
 endif
 endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
 endif
 endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+ifdef UNITTARGETDIR
+override FPCOPT+=-FU$(UNITTARGETDIR)
+ifeq ($(UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(TARGETDIR)/
+endif
+else
+ifdef TARGETDIR
+override UNITTARGETDIR=$(TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+
+# Add commandline options last so they can override
+ifdef OPT
+override FPCOPT+=$(OPT)
 endif
 endif
 
 
 # Add defines from FPCOPTDEF to FPCOPT
 # Add defines from FPCOPTDEF to FPCOPT
@@ -699,11 +775,22 @@ endif
 ifeq ($(OS_SOURCE),win32)
 ifeq ($(OS_SOURCE),win32)
 override FPCEXTCMD:=$(FPCOPT)
 override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
 endif
 endif
 
 
 # Compiler commandline
 # Compiler commandline
 override COMPILER:=$(FPC) $(FPCOPT)
 override COMPILER:=$(FPC) $(FPCOPT)
 
 
+# also call ppas if with command option -s
+# but only if the OS_SOURCE and OS_TARGE are equal
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(OS_SOURCE),$(OS_TARGET))
+EXECPPAS:=@$(PPAS)
+endif
+endif
+
 #####################################################################
 #####################################################################
 # Standard rules
 # Standard rules
 #####################################################################
 #####################################################################
@@ -722,17 +809,23 @@ install: fpc_install
 
 
 sourceinstall: fpc_sourceinstall
 sourceinstall: fpc_sourceinstall
 
 
+exampleinstall: fpc_exampleinstall
+
 zipinstall: fpc_zipinstall
 zipinstall: fpc_zipinstall
 
 
 zipsourceinstall: fpc_zipsourceinstall
 zipsourceinstall: fpc_zipsourceinstall
 
 
+zipexampleinstall: fpc_zipexampleinstall
+
 clean: fpc_clean
 clean: fpc_clean
 
 
+distclean: fpc_distclean
+
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 
 
 info: fpc_info
 info: fpc_info
 
 
-.PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipsourceinstall clean cleanall info
+.PHONY:  all debug smart shared showinstall install sourceinstall exampleinstall zipinstall zipsourceinstall zipexampleinstall clean distclean cleanall info
 
 
 #####################################################################
 #####################################################################
 # Loaders
 # Loaders
@@ -780,9 +873,11 @@ fpc_units: $(UNITPPUFILES)
 # Resource strings
 # Resource strings
 #####################################################################
 #####################################################################
 
 
+ifdef RSTOBJECTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(RSTOBJECTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(RSTOBJECTS))
 
 
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
+endif
 
 
 #####################################################################
 #####################################################################
 # General compile rules
 # General compile rules
@@ -800,25 +895,30 @@ fpc_all: fpc_packages $(FPCMADE)
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
 
 
+# Search paths for .ppu if targetdir is set
+ifdef UNITTARGETDIR
+vpath %$(PPUEXT) $(UNITTARGETDIR)
+endif
+
 # General compile rules, available for both possible PASEXT
 # General compile rules, available for both possible PASEXT
 
 
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
 
 
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+	$(EXECPPAS)
 
 
 %$(PPUEXT): %.pas
 %$(PPUEXT): %.pas
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+	$(EXECPPAS)
 
 
 %$(EXEEXT): %.pp
 %$(EXEEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+	$(EXECPPAS)
 
 
 %$(EXEEXT): %.pas
 %$(EXEEXT): %.pas
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+	$(EXECPPAS)
 
 
 #####################################################################
 #####################################################################
 # Library
 # Library
@@ -826,20 +926,26 @@ fpc_debug:
 
 
 .PHONY: fpc_smart fpc_shared
 .PHONY: fpc_smart fpc_shared
 
 
+ifdef LIBVERSION
+LIBFULLNAME=$(LIBNAME).$(LIBVERSION)
+else
+LIBFULLNAME=$(LIBNAME)
+endif
+
 # Default sharedlib units are all unit objects
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
 SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
 endif
 endif
 
 
 fpc_smart:
 fpc_smart:
-	$(MAKE) all SMARTLINK=1
+	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
-	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
+	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBFULLNAME)
 endif
 endif
 else
 else
 	@$(ECHO) "Shared Libraries not supported"
 	@$(ECHO) "Shared Libraries not supported"
@@ -856,16 +962,17 @@ override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 endif
 
 
 ifdef INSTALLPPUFILES
 ifdef INSTALLPPUFILES
+override INSTALLPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPUFILES))
 ifdef PPUFILES
 ifdef PPUFILES
-ifdef inlinux
 INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
 INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
-INSTALLPPULIBFILES:=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
 else
 else
-INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
 endif
 endif
-else
-INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPULINKFILES))
 endif
 endif
+
+ifdef INSTALLEXEFILES
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
 endif
 endif
 
 
 fpc_showinstall: $(SHOWINSTALLTARGET)
 fpc_showinstall: $(SHOWINSTALLTARGET)
@@ -877,8 +984,11 @@ ifdef INSTALLPPUFILES
 ifneq ($(INSTALLPPULINKFILES),)
 ifneq ($(INSTALLPPULINKFILES),)
 	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
 endif
-ifneq ($(INSTALLPPULIBFILES),)
-	@$(ECHO) -e $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
+ifneq ($(wildcard $(LIBFULLNAME)),)
+	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
+ifdef HASSHAREDLIB
+	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
+endif
 endif
 endif
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
@@ -901,9 +1011,12 @@ ifdef INSTALLPPUFILES
 ifneq ($(INSTALLPPULINKFILES),)
 ifneq ($(INSTALLPPULINKFILES),)
 	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
 	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
 endif
 endif
-ifneq ($(INSTALLPPULIBFILES),)
+ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
-	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
+	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
+ifdef inUnix
+	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
+endif
 endif
 endif
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
@@ -925,6 +1038,24 @@ fpc_sourceinstall: clean
 	$(MKDIR) $(SOURCEINSTALLDIR)
 	$(MKDIR) $(SOURCEINSTALLDIR)
 	$(COPYTREE) $(SOURCETOPDIR) $(SOURCEINSTALLDIR)
 	$(COPYTREE) $(SOURCETOPDIR) $(SOURCEINSTALLDIR)
 
 
+#####################################################################
+# exampleinstall rules
+#####################################################################
+
+.PHONY: fpc_exampleinstall
+
+fpc_exampleinstall: $(addsuffix _clean,$(EXAMPLEDIROBJECTS))
+ifdef EXAMPLESOURCEFILES
+	$(MKDIR) $(EXAMPLEINSTALLDIR)
+	$(COPY) $(EXAMPLESOURCEFILES) $(EXAMPLEINSTALLDIR)
+endif
+ifdef EXAMPLEDIROBJECTS
+ifndef EXAMPLESOURCEFILES
+	$(MKDIR) $(EXAMPLEINSTALLDIR)
+endif
+	$(COPYTREE) $(addsuffix /*,$(EXAMPLEDIROBJECTS)) $(EXAMPLEINSTALLDIR)
+endif
+
 #####################################################################
 #####################################################################
 # Zip
 # Zip
 #####################################################################
 #####################################################################
@@ -944,7 +1075,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -960,7 +1091,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -975,7 +1106,7 @@ ifdef USETAR
 	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
 	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
 	cd $(PACKDIR) ; $(TARPROG) c$(TAROPT) --file $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
 	cd $(PACKDIR) ; $(TARPROG) c$(TAROPT) --file $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
 else
 else
-	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)/$(ZIPEXT)
+	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT)
 	cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR)
 	cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR)
 endif
 endif
 	$(DELTREE) $(PACKDIR)
 	$(DELTREE) $(PACKDIR)
@@ -986,27 +1117,35 @@ endif
 fpc_zipsourceinstall:
 fpc_zipsourceinstall:
 	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall PACKAGESUFFIX=src
 	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall PACKAGESUFFIX=src
 
 
+.PHONY:  fpc_zipexampleinstall
+
+fpc_zipexampleinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall PACKAGESUFFIX=exm
+
 #####################################################################
 #####################################################################
 # Clean rules
 # Clean rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_clean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
 
 
 ifdef EXTRACLEANUNITS
 ifdef EXTRACLEANUNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 endif
 
 
 ifdef CLEANPPUFILES
 ifdef CLEANPPUFILES
+override CLEANPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPUFILES))
+# Get the .o and .a files created for the units
 ifdef PPUFILES
 ifdef PPUFILES
 CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
 CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
 else
 else
-CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
+CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
 endif
 endif
+override CLEANPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPULINKFILES))
 endif
 endif
 
 
 fpc_clean: $(CLEANTARGET)
 fpc_clean: $(CLEANTARGET)
 ifdef CLEANEXEFILES
 ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
+	-$(DEL) $(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
 endif
 endif
 ifdef CLEANPPUFILES
 ifdef CLEANPPUFILES
 	-$(DEL) $(CLEANPPUFILES)
 	-$(DEL) $(CLEANPPUFILES)
@@ -1015,20 +1154,31 @@ ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
 endif
 ifdef CLEANRSTFILES
 ifdef CLEANRSTFILES
-	-$(DEL) $(CLEANRSTFILES)
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
 endif
 endif
 ifdef EXTRACLEANFILES
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 endif
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTCMD) $(REDIRFILE)
+ifdef LIBNAME
+	-$(DEL) $(LIBNAME) $(LIBFULLNAME)
+endif
+	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
+
+fpc_distclean: fpc_clean
+
+# Also run clean first if targetdir is set. Unittargetdir is always
+# set if targetdir or unittargetdir is specified
+ifdef UNITTARGETDIR
+TARGETDIRCLEAN=fpc_clean
+endif
 
 
-fpc_cleanall: $(CLEANTARGET)
+fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 ifdef CLEANEXEFILES
 ifdef CLEANEXEFILES
 	-$(DEL) $(CLEANEXEFILES)
 	-$(DEL) $(CLEANEXEFILES)
 endif
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTCMD) $(REDIRFILE)
+	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
 
 
 #####################################################################
 #####################################################################
 # Info rules
 # Info rules

+ 59 - 49
rtl/os2/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,15 +79,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -164,7 +156,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -193,8 +185,8 @@ endif
 # Targets
 # Targets
 
 
 override LOADEROBJECTS+=prt0 prt1 code2 code3
 override LOADEROBJECTS+=prt0 prt1 code2 code3
-override UNITOBJECTS+=$(SYSTEMUNIT) objpas strings ports os2def doscalls moncalls kbdcalls moucalls viocalls pmbitmap pmwin pmgpi dive pmerr dos crt objects printer sysutils math typinfo varutils ucomplex cpu mmx getopts heaptrc lineinfo
-override RSTOBJECTS+=math varutils
+override UNITOBJECTS+=$(SYSTEMUNIT) objpas strings ports os2def doscalls moncalls kbdcalls moucalls viocalls pmbitmap pmwin pmgpi dive dos crt objects printer sysutils math typinfo varutils ucomplex cpu mmx getopts heaptrc lineinfo dynlibs
+override RSTOBJECTS+=math
 
 
 # Clean
 # Clean
 
 
@@ -253,7 +245,7 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -294,7 +286,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -303,7 +295,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -312,7 +304,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -336,7 +328,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -347,7 +339,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -355,7 +347,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -366,7 +358,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -385,7 +377,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -399,7 +391,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -413,7 +405,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -436,6 +428,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -464,9 +457,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -518,9 +520,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -540,7 +550,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -549,7 +559,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -566,7 +576,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -575,7 +585,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -587,7 +597,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -597,7 +607,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -621,7 +631,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -918,7 +928,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -963,7 +973,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -991,7 +1001,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1052,7 +1062,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1068,7 +1078,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1276,12 +1286,12 @@ pmwin$(PPUEXT) : pmwin.pas os2def$(PPUEXT) $(SYSTEMPPU)
 
 
 pmbitmap$(PPUEXT) : pmbitmap.pas $(SYSTEMPPU)
 pmbitmap$(PPUEXT) : pmbitmap.pas $(SYSTEMPPU)
 
 
-pmerr$(PPUEXT) : pmerr.pas $(SYSTEMPPU)
-
 pmgpi$(PPUEXT) : pmgpi.pas pmbitmap$(PPUEXT) $(SYSTEMPPU)
 pmgpi$(PPUEXT) : pmgpi.pas pmbitmap$(PPUEXT) $(SYSTEMPPU)
 
 
 dive$(PPUEXT) : dive.pas os2def$(PPUEXT) pmwin$(PPUEXT) $(SYSTEMPPU)
 dive$(PPUEXT) : dive.pas os2def$(PPUEXT) pmwin$(PPUEXT) $(SYSTEMPPU)
 
 
+dynlibs$(PPUEXT) : $(INC)/dynlibs.pp doscalls$(PPUEXT) $(SYSTEMPPU)
+
 #
 #
 # TP7 Compatible RTL Units
 # TP7 Compatible RTL Units
 #
 #

+ 55 - 45
rtl/win32/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,15 +79,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -169,7 +161,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -258,7 +250,7 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -299,7 +291,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -308,7 +300,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -317,7 +309,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -341,7 +333,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -352,7 +344,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -360,7 +352,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -371,7 +363,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -390,7 +382,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -404,7 +396,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -418,7 +410,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -441,6 +433,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -469,9 +462,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -523,9 +525,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -545,7 +555,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -554,7 +564,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -571,7 +581,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -580,7 +590,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -592,7 +602,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -602,7 +612,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -626,7 +636,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -923,7 +933,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -968,7 +978,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -996,7 +1006,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1057,7 +1067,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1073,7 +1083,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif

+ 33 - 23
tests/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: info
 defaultrule: info
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -185,6 +177,7 @@ ZIPTARGET=install
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -213,9 +206,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -267,9 +269,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -292,7 +302,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max

+ 56 - 46
tests/units/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: current
 defaultrule: current
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -131,7 +123,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -191,7 +183,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -232,7 +224,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -241,7 +233,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -250,7 +242,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -274,7 +266,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -285,7 +277,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -293,7 +285,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -304,7 +296,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -323,7 +315,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -337,7 +329,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -351,7 +343,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -374,6 +366,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -402,9 +395,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -456,9 +458,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -478,7 +488,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -487,7 +497,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -504,7 +514,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -513,7 +523,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -525,7 +535,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -535,7 +545,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -559,7 +569,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -797,7 +807,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -842,7 +852,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -870,7 +880,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -931,7 +941,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -947,7 +957,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1025,7 +1035,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 47
utils/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -236,7 +228,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -277,7 +269,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -286,7 +278,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -295,7 +287,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -319,7 +311,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -330,7 +322,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -338,7 +330,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -349,7 +341,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -360,7 +352,7 @@ export PPUFILES
 
 
 # data2inc
 # data2inc
 ifndef DATA2INC
 ifndef DATA2INC
-DATA2INC:=$(strip $(wildcard $(addsuffix /data2inc$(EXEEXT),$(SEARCHPATH))))
+DATA2INC:=$(strip $(wildcard $(addsuffix /data2inc$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(DATA2INC),)
 ifeq ($(DATA2INC),)
 DATA2INC=
 DATA2INC=
 else
 else
@@ -379,7 +371,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -393,7 +385,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -407,7 +399,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -430,6 +422,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -458,9 +451,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -661,9 +663,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -683,7 +693,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -692,7 +702,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -709,7 +719,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -718,7 +728,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -730,7 +740,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -740,7 +750,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -764,7 +774,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -1027,7 +1037,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -1072,7 +1082,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1100,7 +1110,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1161,7 +1171,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1177,7 +1187,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1255,7 +1265,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
utils/fprcp/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -219,7 +211,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -260,7 +252,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -269,7 +261,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -278,7 +270,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +294,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -313,7 +305,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -321,7 +313,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -332,7 +324,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -351,7 +343,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -365,7 +357,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -379,7 +371,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -402,6 +394,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -430,9 +423,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -533,9 +535,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -555,7 +565,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -564,7 +574,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -581,7 +591,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -590,7 +600,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -602,7 +612,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -612,7 +622,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -636,7 +646,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -897,7 +907,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -942,7 +952,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -970,7 +980,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1031,7 +1041,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1047,7 +1057,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1125,7 +1135,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
utils/h2pas/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -220,7 +212,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -261,7 +253,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -270,7 +262,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -279,7 +271,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +295,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -314,7 +306,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -322,7 +314,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -333,7 +325,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -352,7 +344,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -366,7 +358,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -380,7 +372,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -403,6 +395,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -431,9 +424,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -534,9 +536,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -556,7 +566,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +575,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +592,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +601,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +613,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +623,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +647,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -902,7 +912,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -947,7 +957,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -975,7 +985,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1036,7 +1046,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1052,7 +1062,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1130,7 +1140,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 46
utils/simulator/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
+# define inUnix when running under Unix (Linux,FreeBSD)
 # define inWinNT when running under WinNT
 # define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 	@exit
 else
 else
-inlinux=1
+inUnix=1
 endif
 endif
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 endif
 endif
 
 
 # Detect NT - NT sets OS to Windows_NT
 # Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inUnix
 ifeq ($(OS),Windows_NT)
 ifeq ($(OS),Windows_NT)
 inWinNT=1
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 ifdef OS2_SHELL
 inOS2=1
 inOS2=1
 endif
 endif
@@ -46,14 +42,14 @@ endif
 endif
 endif
 
 
 # The extension of executables
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 endif
 
 
 # The path which is searched separated by spaces
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -76,15 +72,11 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
-override FPC:=$(subst $(EXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 
 
 # Target OS
 # Target OS
 ifndef OS_TARGET
 ifndef OS_TARGET
@@ -141,7 +133,7 @@ endif
 
 
 # Detect FPCDIR
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-ifdef inlinux
+ifdef inUnix
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@@ -219,7 +211,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHO:=echo
 ECHOE:=echo
 ECHOE:=echo
@@ -260,7 +252,7 @@ endif
 
 
 # To install files
 # To install files
 ifndef INSTALL
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 INSTALL:=install -m 644
 else
 else
 INSTALL:=$(COPY)
 INSTALL:=$(COPY)
@@ -269,7 +261,7 @@ endif
 
 
 # To install programs
 # To install programs
 ifndef INSTALLEXE
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 INSTALLEXE:=install -m 755
 else
 else
 INSTALLEXE:=$(COPY)
 INSTALLEXE:=$(COPY)
@@ -278,7 +270,7 @@ endif
 
 
 # To make a directory.
 # To make a directory.
 ifndef MKDIR
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 MKDIR:=install -m 755 -d
 else
 else
 MKDIR:=ginstall -m 755 -d
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +294,7 @@ LD=ld
 endif
 endif
 
 
 # ppas.bat / ppas.sh
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 PPAS=ppas.sh
 else
 else
 ifdef inOS2
 ifdef inOS2
@@ -313,7 +305,7 @@ endif
 endif
 endif
 
 
 # ldconfig to rebuild .so cache
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 LDCONFIG=ldconfig
 else
 else
 LDCONFIG=
 LDCONFIG=
@@ -321,7 +313,7 @@ endif
 
 
 # ppumove
 # ppumove
 ifndef PPUMOVE
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 PPUMOVE=
 else
 else
@@ -332,7 +324,7 @@ export PPUMOVE
 
 
 # ppufiles
 # ppufiles
 ifndef PPUFILES
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 ifeq ($(PPUFILES),)
 PPUFILES=
 PPUFILES=
 else
 else
@@ -351,7 +343,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 UPXPROG:=1
 endif
 endif
 ifdef UPXPROG
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 ifeq ($(UPXPROG),)
 UPXPROG=
 UPXPROG=
 else
 else
@@ -365,7 +357,7 @@ export UPXPROG
 
 
 # ZipProg, you can't use Zip as the var name (PFV)
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 ZIPPROG=
 else
 else
@@ -379,7 +371,7 @@ ZIPEXT=.zip
 
 
 # Tar
 # Tar
 ifndef TARPROG
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG=
 TARPROG=
 else
 else
@@ -402,6 +394,7 @@ endif
 
 
 # Default needed extensions (Go32v2,Linux)
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPLEXT=.ppl
 PPUEXT=.ppu
 PPUEXT=.ppu
 OEXT=.o
 OEXT=.o
@@ -430,9 +423,18 @@ endif
 
 
 # Linux
 # Linux
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 FPCMADE=fpcmade.lnx
 endif
 endif
 
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 # Win32
 ifeq ($(OS_TARGET),win32)
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
 PPUEXT=.ppw
@@ -533,9 +535,17 @@ endif
 # Default Directories
 # Default Directories
 #####################################################################
 #####################################################################
 
 
+# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
+ifeq ($(OS_TARGET),linux)
+UNIXINSTALLDIR=1
+endif
+ifeq ($(OS_TARGET),freebsd)
+UNIXINSTALLDIR=1
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 PREFIXINSTALLDIR=/usr
 else
 else
 PREFIXINSTALLDIR=/pp
 PREFIXINSTALLDIR=/pp
@@ -555,7 +565,7 @@ export DESTZIPDIR
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -564,7 +574,7 @@ endif
 
 
 # set the directory where to install the binaries
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -581,7 +591,7 @@ endif
 
 
 # Where to install shared libraries
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -590,7 +600,7 @@ endif
 
 
 # Where the source files will be stored
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -602,7 +612,7 @@ endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -612,7 +622,7 @@ endif
 # Where to install the examples, under linux we use the doc dir
 # Where to install the examples, under linux we use the doc dir
 # because the copytree command will create a subdir itself
 # because the copytree command will create a subdir itself
 ifndef EXAMPLEINSTALLDIR
 ifndef EXAMPLEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -636,7 +646,7 @@ REDIRFILE=log
 endif
 endif
 
 
 ifdef REDIR
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 override FPC=redir -eo $(FPC)
 endif
 endif
 # set the verbosity to max
 # set the verbosity to max
@@ -897,7 +907,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 
 fpc_shared: all
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
@@ -942,7 +952,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -970,7 +980,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
 endif
 endif
@@ -1031,7 +1041,7 @@ endif
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
 ifndef PACKDIR
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 else
 PACKDIR=/tmp/fpc-pack
 PACKDIR=/tmp/fpc-pack
@@ -1047,7 +1057,7 @@ endif
 
 
 # Use tar by default under linux
 # Use tar by default under linux
 ifndef USEZIP
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 USETAR=1
 endif
 endif
 endif
 endif
@@ -1125,7 +1135,7 @@ fpc_distclean: fpc_clean
 # Also run clean first if targetdir is set. Unittargetdir is always
 # Also run clean first if targetdir is set. Unittargetdir is always
 # set if targetdir or unittargetdir is specified
 # set if targetdir or unittargetdir is specified
 ifdef UNITTARGETDIR
 ifdef UNITTARGETDIR
-TARGETDIRCLEAN=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 endif
 
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 1 - 5
utils/tply/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v1.00 [2000/09/16]
+# Makefile generated by fpcmake v1.00 [2000/09/20]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -72,13 +72,9 @@ ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
 else
 else
-ifdef inOS2
-FPC=ppos2
-else
 FPC=ppc386
 FPC=ppc386
 endif
 endif
 endif
 endif
-endif
 override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
 override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
 override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
 override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)