Bläddra i källkod

* regenerated

peter 25 år sedan
förälder
incheckning
f8595d5e7e

+ 39 - 35
fcl/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -131,7 +127,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -191,7 +187,7 @@ ZIPTARGET=install
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -232,7 +228,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -241,7 +237,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -250,7 +246,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -274,7 +270,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -285,7 +281,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -293,7 +289,7 @@ endif
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -307,7 +303,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -330,9 +326,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -352,7 +356,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -361,7 +365,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -378,7 +382,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -387,7 +391,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -399,7 +403,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -409,7 +413,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -433,7 +437,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -550,7 +554,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -566,7 +570,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif

+ 55 - 41
fcl/db/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -225,7 +221,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -266,7 +262,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -275,7 +271,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -284,7 +280,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -308,7 +304,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -319,7 +315,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -327,7 +323,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -338,7 +334,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -357,7 +353,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -371,7 +367,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -385,7 +381,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -408,6 +404,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -436,9 +433,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -569,9 +575,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -591,7 +605,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -600,7 +614,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -617,7 +631,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -626,7 +640,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -638,7 +652,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -648,7 +662,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -672,7 +686,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -956,7 +970,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1001,7 +1015,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1029,7 +1043,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1090,7 +1104,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1106,7 +1120,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif

+ 57 - 43
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/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -89,8 +85,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -147,7 +143,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -231,7 +227,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -272,7 +268,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -281,7 +277,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -290,7 +286,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -314,7 +310,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -325,7 +321,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -333,7 +329,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -344,7 +340,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -363,7 +359,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -377,7 +373,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -391,7 +387,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -414,6 +410,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -442,9 +439,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -605,9 +611,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -622,7 +636,7 @@ endif
 export DESTZIPDIR
 
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
@@ -635,7 +649,7 @@ export GCCLIBDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -644,7 +658,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -661,7 +675,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -670,7 +684,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -682,7 +696,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -692,7 +706,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -716,7 +730,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -1000,7 +1014,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1045,7 +1059,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1073,7 +1087,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1134,7 +1148,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1150,7 +1164,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1228,7 +1242,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 43
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/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -594,9 +600,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -611,7 +625,7 @@ endif
 export DESTZIPDIR
 
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
@@ -624,7 +638,7 @@ export GCCLIBDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -633,7 +647,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -650,7 +664,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -659,7 +673,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -671,7 +685,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -681,7 +695,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -705,7 +719,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -975,7 +989,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1020,7 +1034,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1048,7 +1062,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1109,7 +1123,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1125,7 +1139,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1203,7 +1217,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 55 - 41
fcl/shedit/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -224,7 +220,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -265,7 +261,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -274,7 +270,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -283,7 +279,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -307,7 +303,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -318,7 +314,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -326,7 +322,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -337,7 +333,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -356,7 +352,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -370,7 +366,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -384,7 +380,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -407,6 +403,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -435,9 +432,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -538,9 +544,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -560,7 +574,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -569,7 +583,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -586,7 +600,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -595,7 +609,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -607,7 +621,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -617,7 +631,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -641,7 +655,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -903,7 +917,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -948,7 +962,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -976,7 +990,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1037,7 +1051,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1053,7 +1067,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif

+ 56 - 42
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/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -219,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -260,7 +256,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -269,7 +265,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -278,7 +274,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +298,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -313,7 +309,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -321,7 +317,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -332,7 +328,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -351,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -365,7 +361,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -379,7 +375,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -402,6 +398,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -430,9 +427,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -593,9 +599,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -615,7 +629,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -624,7 +638,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -641,7 +655,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -650,7 +664,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -662,7 +676,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -672,7 +686,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -696,7 +710,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -971,7 +985,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1016,7 +1030,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1044,7 +1058,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1105,7 +1119,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1121,7 +1135,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1199,7 +1213,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 55 - 41
fcl/xml/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -224,7 +220,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -265,7 +261,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -274,7 +270,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -283,7 +279,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -307,7 +303,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -318,7 +314,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -326,7 +322,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -337,7 +333,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -356,7 +352,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -370,7 +366,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -384,7 +380,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -407,6 +403,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -435,9 +432,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -538,9 +544,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -560,7 +574,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -569,7 +583,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -586,7 +600,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -595,7 +609,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -607,7 +621,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -617,7 +631,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -641,7 +655,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -903,7 +917,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -948,7 +962,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -976,7 +990,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1037,7 +1051,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1053,7 +1067,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif

+ 39 - 35
ide/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -131,7 +127,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -189,7 +185,7 @@ ZIPTARGET=install
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -230,7 +226,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -239,7 +235,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -248,7 +244,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -272,7 +268,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -283,7 +279,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -291,7 +287,7 @@ endif
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -305,7 +301,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -328,9 +324,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -350,7 +354,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -359,7 +363,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -376,7 +380,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -385,7 +389,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -397,7 +401,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -407,7 +411,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -431,7 +435,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -502,7 +506,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -518,7 +522,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif

+ 39 - 35
packages/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/02]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -131,7 +127,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -197,7 +193,7 @@ ZIPTARGET=install
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -238,7 +234,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -247,7 +243,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -256,7 +252,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -280,7 +276,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -291,7 +287,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -299,7 +295,7 @@ endif
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -313,7 +309,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -737,9 +733,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -759,7 +763,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -768,7 +772,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -785,7 +789,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -794,7 +798,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -806,7 +810,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -816,7 +820,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -840,7 +844,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -939,7 +943,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -955,7 +959,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif

+ 56 - 42
packages/cmem/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/forms/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -221,7 +217,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -262,7 +258,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -271,7 +267,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -280,7 +276,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -304,7 +300,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -315,7 +311,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -323,7 +319,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -334,7 +330,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -353,7 +349,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -367,7 +363,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -381,7 +377,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -404,6 +400,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -432,9 +429,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -565,9 +571,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -587,7 +601,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -596,7 +610,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -613,7 +627,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -622,7 +636,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -634,7 +648,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -644,7 +658,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -668,7 +682,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -965,7 +979,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1010,7 +1024,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1038,7 +1052,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1099,7 +1113,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1115,7 +1129,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1193,7 +1207,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 43
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/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -219,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -260,7 +256,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -269,7 +265,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -278,7 +274,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +298,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -313,7 +309,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -321,7 +317,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -332,7 +328,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -351,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -365,7 +361,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -379,7 +375,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -402,6 +398,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -430,9 +427,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -593,9 +599,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -610,7 +624,7 @@ endif
 export DESTZIPDIR
 
 # Where to find other libraries
-ifdef inlinux
+ifdef inUnix
 ifndef OTHERLIBDIR
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 endif
@@ -623,7 +637,7 @@ export OTHERLIBDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -632,7 +646,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -649,7 +663,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -658,7 +672,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -670,7 +684,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -680,7 +694,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -704,7 +718,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -970,7 +984,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1015,7 +1029,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1043,7 +1057,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1104,7 +1118,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1120,7 +1134,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1198,7 +1212,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 43
packages/gdbint/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -226,7 +222,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -267,7 +263,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -276,7 +272,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -285,7 +281,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -309,7 +305,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -320,7 +316,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -328,7 +324,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -339,7 +335,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -358,7 +354,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -372,7 +368,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -386,7 +382,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -409,6 +405,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -437,9 +434,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -540,9 +546,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -557,7 +571,7 @@ endif
 export DESTZIPDIR
 
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
@@ -570,7 +584,7 @@ export GCCLIBDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -579,7 +593,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -596,7 +610,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -605,7 +619,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -617,7 +631,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -627,7 +641,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -651,7 +665,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -942,7 +956,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -987,7 +1001,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1015,7 +1029,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1076,7 +1090,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1092,7 +1106,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1170,7 +1184,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 23 - 19
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/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -131,7 +127,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -185,9 +181,17 @@ ZIPTARGET=install
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -210,7 +214,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max

+ 56 - 42
packages/ggi/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/gtk/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -226,7 +222,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -267,7 +263,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -276,7 +272,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -285,7 +281,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -309,7 +305,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -320,7 +316,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -328,7 +324,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -339,7 +335,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -358,7 +354,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -372,7 +368,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -386,7 +382,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -409,6 +405,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -437,9 +434,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -540,9 +546,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -562,7 +576,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -571,7 +585,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -588,7 +602,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -597,7 +611,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -609,7 +623,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -619,7 +633,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -643,7 +657,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -923,7 +937,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -968,7 +982,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -996,7 +1010,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1057,7 +1071,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1073,7 +1087,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1151,7 +1165,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 43
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/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -225,7 +221,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -266,7 +262,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -275,7 +271,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -284,7 +280,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -308,7 +304,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -319,7 +315,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -327,7 +323,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -338,7 +334,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -357,7 +353,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -371,7 +367,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -385,7 +381,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -408,6 +404,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -436,9 +433,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -569,9 +575,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -586,7 +600,7 @@ endif
 export DESTZIPDIR
 
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
@@ -594,7 +608,7 @@ endif
 export GCCLIBDIR
 
 # Where to find other libraries
-ifdef inlinux
+ifdef inUnix
 ifndef OTHERLIBDIR
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 endif
@@ -607,7 +621,7 @@ export OTHERLIBDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -616,7 +630,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -633,7 +647,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -642,7 +656,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -654,7 +668,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -664,7 +678,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -688,7 +702,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -961,7 +975,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1006,7 +1020,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1034,7 +1048,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1095,7 +1109,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1111,7 +1125,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif

+ 58 - 44
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/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -223,7 +219,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -264,7 +260,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -273,7 +269,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -282,7 +278,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -306,7 +302,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -317,7 +313,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -325,7 +321,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -336,7 +332,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -355,7 +351,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -369,7 +365,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -383,7 +379,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -406,6 +402,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -434,9 +431,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -567,9 +573,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -584,7 +598,7 @@ endif
 export DESTZIPDIR
 
 # On linux, try to find where libgcc.a is.
-ifdef inlinux
+ifdef inUnix
 ifndef GCCLIBDIR
 GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
 endif
@@ -592,7 +606,7 @@ endif
 export GCCLIBDIR
 
 # Where to find other libraries
-ifdef inlinux
+ifdef inUnix
 ifndef OTHERLIBDIR
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 endif
@@ -605,7 +619,7 @@ export OTHERLIBDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -614,7 +628,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -631,7 +645,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -640,7 +654,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -652,7 +666,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -662,7 +676,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -686,7 +700,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -957,7 +971,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1002,7 +1016,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1030,7 +1044,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1091,7 +1105,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1107,7 +1121,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1185,7 +1199,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/ibase/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/inet/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/mysql/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/ncurses/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 174 - 89
packages/opengl/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -131,7 +127,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -159,7 +155,12 @@ endif
 
 # Targets
 
-override DIROBJECTS+=$(wildcard linux build)
+ifeq ($(OS_TARGET),linux)
+override DIROBJECTS+=$(wildcard linux gtkgl)
+endif
+ifeq ($(OS_TARGET),win32)
+override DIROBJECTS+=$(wildcard win32 gtkgl)
+endif
 override EXAMPLEDIROBJECTS+=examples
 
 # Clean
@@ -195,7 +196,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -236,7 +237,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -245,7 +246,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -254,7 +255,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -278,7 +279,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -289,7 +290,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -297,7 +298,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -308,7 +309,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -327,7 +328,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -341,7 +342,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -355,7 +356,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -378,6 +379,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -406,9 +408,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -460,9 +471,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -482,7 +501,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -491,7 +510,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -508,7 +527,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -517,7 +536,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -529,7 +548,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -539,7 +558,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -563,7 +582,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -709,21 +728,21 @@ endif
 # Standard rules
 #####################################################################
 
-all: fpc_all $(addsuffix _all,$(OS_TARGET))
+all: fpc_all $(addsuffix _all,$(DIROBJECTS))
 
-debug: fpc_debug $(addsuffix _debug,$(OS_TARGET))
+debug: fpc_debug $(addsuffix _debug,$(DIROBJECTS))
 
 examples: fpc_examples
 
 test: fpc_test
 
-smart: fpc_smart $(addsuffix _smart,$(OS_TARGET))
+smart: fpc_smart $(addsuffix _smart,$(DIROBJECTS))
 
-shared: fpc_shared $(addsuffix _shared,$(OS_TARGET))
+shared: fpc_shared $(addsuffix _shared,$(DIROBJECTS))
 
-showinstall: fpc_showinstall $(addsuffix _showinstall,$(OS_TARGET))
+showinstall: fpc_showinstall $(addsuffix _showinstall,$(DIROBJECTS))
 
-install: fpc_install $(addsuffix _install,$(OS_TARGET))
+install: fpc_install $(addsuffix _install,$(DIROBJECTS))
 
 sourceinstall: fpc_sourceinstall
 
@@ -827,7 +846,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -872,7 +891,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -900,7 +919,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -961,7 +980,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -977,7 +996,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1055,7 +1074,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
@@ -1132,8 +1151,14 @@ endif
 # Directories
 #####################################################################
 
+ifeq ($(OS_TARGET),linux)
 OBJECTDIRLINUX=1
-OBJECTDIRBUILD=1
+OBJECTDIRGTKGL=1
+endif
+ifeq ($(OS_TARGET),win32)
+OBJECTDIRWIN32=1
+OBJECTDIRGTKGL=1
+endif
 
 # Dir linux
 
@@ -1195,64 +1220,124 @@ linux_info:
 	$(MAKE) -C linux info
 endif
 
-# Dir build
+# Dir gtkgl
+
+ifdef OBJECTDIRGTKGL
+.PHONY:  gtkgl_all gtkgl_debug gtkgl_examples gtkgl_test gtkgl_smart gtkgl_shared gtkgl_showinstall gtkgl_install gtkgl_sourceinstall gtkgl_exampleinstall gtkgl_zipinstall gtkgl_zipsourceinstall gtkgl_zipexampleinstall gtkgl_clean gtkgl_distclean gtkgl_cleanall gtkgl_require gtkgl_info
+
+gtkgl_all:
+	$(MAKE) -C gtkgl all
+
+gtkgl_debug:
+	$(MAKE) -C gtkgl debug
+
+gtkgl_examples:
+	$(MAKE) -C gtkgl examples
+
+gtkgl_test:
+	$(MAKE) -C gtkgl test
+
+gtkgl_smart:
+	$(MAKE) -C gtkgl smart
+
+gtkgl_shared:
+	$(MAKE) -C gtkgl shared
+
+gtkgl_showinstall:
+	$(MAKE) -C gtkgl showinstall
+
+gtkgl_install:
+	$(MAKE) -C gtkgl install
+
+gtkgl_sourceinstall:
+	$(MAKE) -C gtkgl sourceinstall
+
+gtkgl_exampleinstall:
+	$(MAKE) -C gtkgl exampleinstall
+
+gtkgl_zipinstall:
+	$(MAKE) -C gtkgl zipinstall
+
+gtkgl_zipsourceinstall:
+	$(MAKE) -C gtkgl zipsourceinstall
+
+gtkgl_zipexampleinstall:
+	$(MAKE) -C gtkgl zipexampleinstall
+
+gtkgl_clean:
+	$(MAKE) -C gtkgl clean
+
+gtkgl_distclean:
+	$(MAKE) -C gtkgl distclean
+
+gtkgl_cleanall:
+	$(MAKE) -C gtkgl cleanall
+
+gtkgl_require:
+	$(MAKE) -C gtkgl require
+
+gtkgl_info:
+	$(MAKE) -C gtkgl info
+endif
+
+# Dir win32
 
-ifdef OBJECTDIRBUILD
-.PHONY:  build_all build_debug build_examples build_test build_smart build_shared build_showinstall build_install build_sourceinstall build_exampleinstall build_zipinstall build_zipsourceinstall build_zipexampleinstall build_clean build_distclean build_cleanall build_require build_info
+ifdef OBJECTDIRWIN32
+.PHONY:  win32_all win32_debug win32_examples win32_test win32_smart win32_shared win32_showinstall win32_install win32_sourceinstall win32_exampleinstall win32_zipinstall win32_zipsourceinstall win32_zipexampleinstall win32_clean win32_distclean win32_cleanall win32_require win32_info
 
-build_all:
-	$(MAKE) -C build all
+win32_all:
+	$(MAKE) -C win32 all
 
-build_debug:
-	$(MAKE) -C build debug
+win32_debug:
+	$(MAKE) -C win32 debug
 
-build_examples:
-	$(MAKE) -C build examples
+win32_examples:
+	$(MAKE) -C win32 examples
 
-build_test:
-	$(MAKE) -C build test
+win32_test:
+	$(MAKE) -C win32 test
 
-build_smart:
-	$(MAKE) -C build smart
+win32_smart:
+	$(MAKE) -C win32 smart
 
-build_shared:
-	$(MAKE) -C build shared
+win32_shared:
+	$(MAKE) -C win32 shared
 
-build_showinstall:
-	$(MAKE) -C build showinstall
+win32_showinstall:
+	$(MAKE) -C win32 showinstall
 
-build_install:
-	$(MAKE) -C build install
+win32_install:
+	$(MAKE) -C win32 install
 
-build_sourceinstall:
-	$(MAKE) -C build sourceinstall
+win32_sourceinstall:
+	$(MAKE) -C win32 sourceinstall
 
-build_exampleinstall:
-	$(MAKE) -C build exampleinstall
+win32_exampleinstall:
+	$(MAKE) -C win32 exampleinstall
 
-build_zipinstall:
-	$(MAKE) -C build zipinstall
+win32_zipinstall:
+	$(MAKE) -C win32 zipinstall
 
-build_zipsourceinstall:
-	$(MAKE) -C build zipsourceinstall
+win32_zipsourceinstall:
+	$(MAKE) -C win32 zipsourceinstall
 
-build_zipexampleinstall:
-	$(MAKE) -C build zipexampleinstall
+win32_zipexampleinstall:
+	$(MAKE) -C win32 zipexampleinstall
 
-build_clean:
-	$(MAKE) -C build clean
+win32_clean:
+	$(MAKE) -C win32 clean
 
-build_distclean:
-	$(MAKE) -C build distclean
+win32_distclean:
+	$(MAKE) -C win32 distclean
 
-build_cleanall:
-	$(MAKE) -C build cleanall
+win32_cleanall:
+	$(MAKE) -C win32 cleanall
 
-build_require:
-	$(MAKE) -C build require
+win32_require:
+	$(MAKE) -C win32 require
 
-build_info:
-	$(MAKE) -C build info
+win32_info:
+	$(MAKE) -C win32 info
 endif
 EXAMPLEDIREXAMPLES=1
 

+ 76 - 44
packages/opengl/build/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
-defaultrule: all
+defaultrule: all_units
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -185,7 +181,7 @@ endif
 # Targets
 
 override UNITOBJECTS+=buildgl
-override EXEOBJECTS+=c_linuxd
+override EXEOBJECTS+=c_gen
 
 # Clean
 
@@ -219,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -260,7 +256,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -269,7 +265,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -278,7 +274,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +298,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -313,7 +309,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -321,7 +317,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -332,7 +328,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -351,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -365,7 +361,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -379,7 +375,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -402,6 +398,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -430,9 +427,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -563,9 +569,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -585,7 +599,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -594,7 +608,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -611,7 +625,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -620,7 +634,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -632,7 +646,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -642,7 +656,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -666,7 +680,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -941,7 +955,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -986,7 +1000,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1014,7 +1028,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1075,7 +1089,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1091,7 +1105,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1169,7 +1183,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
@@ -1250,3 +1264,21 @@ ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 endif
 
+#####################################################################
+# Users rules
+#####################################################################
+
+.PHONY: all_units linux win32 w32d w32s
+
+all_units: linux win32
+
+linux: c_gen$(EXEEXT) ogl_linux.gen
+	c_gen ogl_linux.gen
+
+win32: w32d w32s
+
+w32d: c_gen$(EXEEXT) ogl_w32d.gen
+	c_gen ogl_w32d.gen
+
+w32s: c_gen$(EXEEXT) ogl_w32s.gen
+	c_gen ogl_w32s.gen

+ 78 - 45
packages/opengl/examples/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -184,7 +180,7 @@ endif
 
 # Targets
 
-override EXEOBJECTS+=glutdemo
+override EXEOBJECTS+=glutdemo morph3d
 
 # Clean
 
@@ -201,10 +197,14 @@ ZIPTARGET=install
 
 # Packages
 
-override PACKAGES+=rtl opengl x11
+override PACKAGES+=rtl opengl
+ifeq ($(OS_TARGET),linux)
+override PACKAGES+=x11
+endif
 
 # Libraries
 
+override NEEDGCCLIB=1
 override NEEDOTHERLIB=1
 
 # Info
@@ -219,7 +219,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -260,7 +260,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -269,7 +269,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -278,7 +278,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +302,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -313,7 +313,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -321,7 +321,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -332,7 +332,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -351,7 +351,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -365,7 +365,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -379,7 +379,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -402,6 +402,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -430,9 +431,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -498,7 +508,9 @@ endif
 
 PACKAGERTL=1
 PACKAGEOPENGL=1
+ifeq ($(OS_TARGET),linux)
 PACKAGEX11=1
+endif
 
 ifdef PACKAGERTL
 ifneq ($(wildcard $(FPCDIR)/rtl),)
@@ -593,9 +605,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -609,8 +629,16 @@ DESTZIPDIR:=$(BASEDIR)
 endif
 export DESTZIPDIR
 
+# On linux, try to find where libgcc.a is.
+ifdef inUnix
+ifndef GCCLIBDIR
+GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
+endif
+endif
+export GCCLIBDIR
+
 # Where to find other libraries
-ifdef inlinux
+ifdef inUnix
 ifndef OTHERLIBDIR
 OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
 endif
@@ -623,7 +651,7 @@ export OTHERLIBDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -632,7 +660,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -649,7 +677,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -658,7 +686,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -670,7 +698,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -680,7 +708,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -704,7 +732,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -787,6 +815,11 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+# Add GCC lib path if asked
+ifdef GCCLIBDIR
+override FPCOPT+=-Fl$(GCCLIBDIR)
+endif
+
 # Add Other dirs path if asked
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
@@ -970,7 +1003,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1015,7 +1048,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1043,7 +1076,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1104,7 +1137,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1120,7 +1153,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1198,7 +1231,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/paszlib/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -221,7 +217,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -262,7 +258,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -271,7 +267,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -280,7 +276,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -304,7 +300,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -315,7 +311,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -323,7 +319,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -334,7 +330,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -353,7 +349,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -367,7 +363,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -381,7 +377,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -404,6 +400,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -432,9 +429,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -535,9 +541,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -557,7 +571,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -566,7 +580,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -583,7 +597,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -592,7 +606,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -604,7 +618,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -614,7 +628,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -638,7 +652,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -918,7 +932,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -963,7 +977,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -991,7 +1005,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1052,7 +1066,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1068,7 +1082,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1146,7 +1160,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/postgres/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/regexpr/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -221,7 +217,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -262,7 +258,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -271,7 +267,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -280,7 +276,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -304,7 +300,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -315,7 +311,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -323,7 +319,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -334,7 +330,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -353,7 +349,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -367,7 +363,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -381,7 +377,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -404,6 +400,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -432,9 +429,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -535,9 +541,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -557,7 +571,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -566,7 +580,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -583,7 +597,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -592,7 +606,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -604,7 +618,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -614,7 +628,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -638,7 +652,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -922,7 +936,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -967,7 +981,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -995,7 +1009,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1056,7 +1070,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1072,7 +1086,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1150,7 +1164,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/svgalib/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/syslog/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/uncgi/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -915,7 +929,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -960,7 +974,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -988,7 +1002,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1049,7 +1063,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1065,7 +1079,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1143,7 +1157,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/utmp/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -917,7 +931,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -962,7 +976,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -990,7 +1004,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1051,7 +1065,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1067,7 +1081,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1145,7 +1159,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/x11/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -218,7 +214,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -259,7 +255,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -268,7 +264,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -277,7 +273,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -301,7 +297,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -312,7 +308,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -320,7 +316,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -331,7 +327,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -350,7 +346,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -364,7 +360,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -378,7 +374,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -401,6 +397,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -429,9 +426,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -532,9 +538,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -554,7 +568,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -563,7 +577,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -580,7 +594,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -589,7 +603,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -601,7 +615,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -611,7 +625,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -635,7 +649,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -893,7 +907,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -938,7 +952,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -966,7 +980,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1027,7 +1041,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1043,7 +1057,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1121,7 +1135,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
packages/zlib/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -218,7 +214,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -259,7 +255,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -268,7 +264,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -277,7 +273,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -301,7 +297,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -312,7 +308,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -320,7 +316,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -331,7 +327,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -350,7 +346,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -364,7 +360,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -378,7 +374,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -401,6 +397,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -429,9 +426,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -532,9 +538,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -554,7 +568,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -563,7 +577,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -580,7 +594,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -589,7 +603,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -601,7 +615,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -611,7 +625,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -635,7 +649,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -893,7 +907,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -938,7 +952,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -966,7 +980,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1027,7 +1041,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1043,7 +1057,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1121,7 +1135,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 57 - 43
utils/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -236,7 +232,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -277,7 +273,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -286,7 +282,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -295,7 +291,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -319,7 +315,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -330,7 +326,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -338,7 +334,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -349,7 +345,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -360,7 +356,7 @@ export PPUFILES
 
 # data2inc
 ifndef DATA2INC
-DATA2INC:=$(strip $(wildcard $(addsuffix /data2inc$(EXEEXT),$(SEARCHPATH))))
+DATA2INC:=$(strip $(wildcard $(addsuffix /data2inc$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(DATA2INC),)
 DATA2INC=
 else
@@ -379,7 +375,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -393,7 +389,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -407,7 +403,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -430,6 +426,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -458,9 +455,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -661,9 +667,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -683,7 +697,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -692,7 +706,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -709,7 +723,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -718,7 +732,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -730,7 +744,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -740,7 +754,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -764,7 +778,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -1027,7 +1041,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -1072,7 +1086,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1100,7 +1114,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1161,7 +1175,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1177,7 +1191,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1255,7 +1269,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
utils/fprcp/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -219,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -260,7 +256,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -269,7 +265,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -278,7 +274,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +298,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -313,7 +309,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -321,7 +317,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -332,7 +328,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -351,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -365,7 +361,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -379,7 +375,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -402,6 +398,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -430,9 +427,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -533,9 +539,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -555,7 +569,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -564,7 +578,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -581,7 +595,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -590,7 +604,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -602,7 +616,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -612,7 +626,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -636,7 +650,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -897,7 +911,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -942,7 +956,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -970,7 +984,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1031,7 +1045,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1047,7 +1061,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1125,7 +1139,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
utils/h2pas/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -220,7 +216,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -261,7 +257,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -270,7 +266,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -279,7 +275,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -303,7 +299,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -314,7 +310,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -322,7 +318,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -333,7 +329,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -352,7 +348,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -366,7 +362,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -380,7 +376,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -403,6 +399,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -431,9 +428,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -534,9 +540,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -556,7 +570,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -565,7 +579,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -582,7 +596,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -591,7 +605,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -603,7 +617,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -613,7 +627,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -637,7 +651,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -902,7 +916,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -947,7 +961,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -975,7 +989,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1036,7 +1050,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1052,7 +1066,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1130,7 +1144,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 56 - 42
utils/simulator/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -141,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -219,7 +215,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -260,7 +256,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -269,7 +265,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -278,7 +274,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -302,7 +298,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -313,7 +309,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -321,7 +317,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -332,7 +328,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -351,7 +347,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -365,7 +361,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -379,7 +375,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -402,6 +398,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -430,9 +427,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -533,9 +539,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -555,7 +569,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -564,7 +578,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -581,7 +595,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -590,7 +604,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -602,7 +616,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -612,7 +626,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -636,7 +650,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -897,7 +911,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -942,7 +956,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -970,7 +984,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1031,7 +1045,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1047,7 +1061,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1125,7 +1139,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)

+ 67 - 56
utils/tply/Makefile

@@ -1,12 +1,12 @@
 #
-# Makefile generated by fpcmake v1.00 [2000/09/01]
+# Makefile generated by fpcmake v1.00 [2000/09/16]
 #
 
 defaultrule: all
 
 #####################################################################
 # 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
 #####################################################################
 
@@ -23,22 +23,18 @@ nopwd:
 	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
 	@exit
 else
-inlinux=1
+inUnix=1
 endif
 else
 PWD:=$(firstword $(PWD))
 endif
 
 # 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)
 inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
+else
 ifdef OS2_SHELL
 inOS2=1
 endif
@@ -46,14 +42,14 @@ endif
 endif
 
 # The extension of executables
-ifdef inlinux
-EXEEXT=
+ifdef inUnix
+SRCEXEEXT=
 else
-EXEEXT=.exe
+SRCEXEEXT=.exe
 endif
 
 # The path which is searched separated by spaces
-ifdef inlinux
+ifdef inUnix
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
@@ -83,8 +79,8 @@ FPC=ppc386
 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
 ifndef OS_TARGET
@@ -113,15 +109,6 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-#####################################################################
-# Pre Settings
-#####################################################################
-
-ifdef inlinux
-CODPATH=$(PREFIXINSTALLDIR)/lib/fpc/lexyacc
-else
-CODPATH=$(BININSTALLDIR)
-endif
 #####################################################################
 # FPCDIR Setting
 #####################################################################
@@ -150,7 +137,7 @@ endif
 
 # Detect FPCDIR
 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)
@@ -202,8 +189,6 @@ override EXTRACLEANUNITS+=lexbase lexopt lexdfa lexpos lexlist lexrules lexmsgs
 
 # Install
 
-override EXTRAINSTALLFILES+=yylex.cod yyparse.cod
-DATAINSTALLDIR=$(CODPATH)
 ZIPTARGET=install
 
 # Defaults
@@ -232,7 +217,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
 ECHO:=echo
 ECHOE:=echo
@@ -273,7 +258,7 @@ endif
 
 # To install files
 ifndef INSTALL
-ifdef inlinux
+ifdef inUnix
 INSTALL:=install -m 644
 else
 INSTALL:=$(COPY)
@@ -282,7 +267,7 @@ endif
 
 # To install programs
 ifndef INSTALLEXE
-ifdef inlinux
+ifdef inUnix
 INSTALLEXE:=install -m 755
 else
 INSTALLEXE:=$(COPY)
@@ -291,7 +276,7 @@ endif
 
 # To make a directory.
 ifndef MKDIR
-ifdef inlinux
+ifdef inUnix
 MKDIR:=install -m 755 -d
 else
 MKDIR:=ginstall -m 755 -d
@@ -315,7 +300,7 @@ LD=ld
 endif
 
 # ppas.bat / ppas.sh
-ifdef inlinux
+ifdef inUnix
 PPAS=ppas.sh
 else
 ifdef inOS2
@@ -326,7 +311,7 @@ endif
 endif
 
 # ldconfig to rebuild .so cache
-ifdef inlinux
+ifdef inUnix
 LDCONFIG=ldconfig
 else
 LDCONFIG=
@@ -334,7 +319,7 @@ endif
 
 # ppumove
 ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
@@ -345,7 +330,7 @@ export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
-PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
@@ -364,7 +349,7 @@ ifeq ($(OS_TARGET),win32)
 UPXPROG:=1
 endif
 ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
@@ -378,7 +363,7 @@ export UPXPROG
 
 # ZipProg, you can't use Zip as the var name (PFV)
 ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
@@ -392,7 +377,7 @@ ZIPEXT=.zip
 
 # Tar
 ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG=
 else
@@ -415,6 +400,7 @@ endif
 
 # Default needed extensions (Go32v2,Linux)
 LOADEREXT=.as
+EXEEXT=.exe
 PPLEXT=.ppl
 PPUEXT=.ppu
 OEXT=.o
@@ -443,9 +429,18 @@ endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
+EXEEXT=
+HASSHAREDLIB=1
 FPCMADE=fpcmade.lnx
 endif
 
+# Linux
+ifeq ($(OS_TARGET),freebsd)
+EXEEXT=
+HASSHAREDLIB=1
+FPCMADE=fpcmade.freebsd
+endif
+
 # Win32
 ifeq ($(OS_TARGET),win32)
 PPUEXT=.ppw
@@ -546,9 +541,17 @@ endif
 # 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
 ifndef PREFIXINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 PREFIXINSTALLDIR=/usr
 else
 PREFIXINSTALLDIR=/pp
@@ -568,7 +571,7 @@ export DESTZIPDIR
 
 # set the base directory where to install everything
 ifndef BASEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
 else
 BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@@ -577,7 +580,7 @@ endif
 
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
 else
 BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@@ -594,7 +597,7 @@ endif
 
 # Where to install shared libraries
 ifndef LIBINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
 else
 LIBINSTALLDIR=$(UNITINSTALLDIR)
@@ -603,7 +606,7 @@ endif
 
 # Where the source files will be stored
 ifndef SOURCEINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
 else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@@ -615,7 +618,7 @@ endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
-ifdef inlinux
+ifdef UNIXINSTALLDIR
 DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@@ -625,7 +628,7 @@ 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 inlinux
+ifdef UNIXINSTALLDIR
 EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
 else
 EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@@ -649,7 +652,7 @@ REDIRFILE=log
 endif
 
 ifdef REDIR
-ifndef inlinux
+ifndef inUnix
 override FPC=redir -eo $(FPC)
 endif
 # set the verbosity to max
@@ -813,8 +816,6 @@ shared: fpc_shared
 
 showinstall: fpc_showinstall
 
-install: fpc_install
-
 sourceinstall: fpc_sourceinstall
 
 exampleinstall: fpc_exampleinstall
@@ -833,7 +834,7 @@ cleanall: fpc_cleanall
 
 info: fpc_info
 
-.PHONY:  all debug smart shared showinstall install sourceinstall exampleinstall zipinstall zipsourceinstall zipexampleinstall clean distclean cleanall info
+.PHONY:  all debug smart shared showinstall sourceinstall exampleinstall zipinstall zipsourceinstall zipexampleinstall clean distclean cleanall info
 
 #####################################################################
 # Units
@@ -928,7 +929,7 @@ fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 
 fpc_shared: all
-ifdef inlinux
+ifdef HASSHAREDLIB
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 else
@@ -973,7 +974,7 @@ ifneq ($(INSTALLPPULINKFILES),)
 endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
-ifdef inlinux
+ifdef HASSHAREDLIB
 	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1001,7 +1002,7 @@ endif
 ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
-ifdef inlinux
+ifdef inUnix
 	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
 endif
 endif
@@ -1062,7 +1063,7 @@ endif
 
 # Temporary path to pack a file
 ifndef PACKDIR
-ifndef inlinux
+ifndef inUnix
 PACKDIR=$(BASEDIR)/pack_tmp
 else
 PACKDIR=/tmp/fpc-pack
@@ -1078,7 +1079,7 @@ endif
 
 # Use tar by default under linux
 ifndef USEZIP
-ifdef inlinux
+ifdef inUnix
 USETAR=1
 endif
 endif
@@ -1156,7 +1157,7 @@ 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=clean
+TARGETDIRCLEAN=fpc_clean
 endif
 
 fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
@@ -1250,3 +1251,13 @@ plex$(EXEEXT): plex$(PASEXT) $(wildcard lex*$(PASEXT))
 lexlib$(PPUEXT): lexlib$(PASEXT)
 
 yacclib$(PPUEXT): yacclib$(PASEXT)
+
+ifdef UNIXINSTALLDIR
+CODPATH=$(PREFIXINSTALLDIR)/lib/fpc/lexyacc
+else
+CODPATH=$(BININSTALLDIR)
+endif
+
+install: fpc_install
+	$(MKDIR) $(CODPATH)
+	$(COPY) yylex.cod yyparse.cod $(CODPATH)

+ 10 - 12
utils/tply/Makefile.fpc

@@ -10,10 +10,6 @@ units=lexlib yacclib
 units=lexbase lexopt lexdfa lexpos lexlist lexrules lexmsgs lextable \
       yaccbase yaccmsgs yaccclos yaccpars yacclook yaccsem yacclr0 yacctabl
 
-[install]
-files=yylex.cod yyparse.cod
-datadir=$(CODPATH)
-
 [dirs]
 fpcdir=../..
 
@@ -21,14 +17,6 @@ fpcdir=../..
 options=-Sg
 
 
-[presettings]
-ifdef inlinux
-CODPATH=$(PREFIXINSTALLDIR)/lib/fpc/lexyacc
-else
-CODPATH=$(BININSTALLDIR)
-endif
-
-
 [rules]
 pyacc$(EXEEXT): pyacc$(PASEXT) $(wildcard yacc*$(PASEXT))
         $(COMPILER) pyacc$(PASEXT) $(REDIR)
@@ -39,3 +27,13 @@ plex$(EXEEXT): plex$(PASEXT) $(wildcard lex*$(PASEXT))
 lexlib$(PPUEXT): lexlib$(PASEXT)
 
 yacclib$(PPUEXT): yacclib$(PASEXT)
+
+ifdef UNIXINSTALLDIR
+CODPATH=$(PREFIXINSTALLDIR)/lib/fpc/lexyacc
+else
+CODPATH=$(BININSTALLDIR)
+endif
+
+install: fpc_install
+	$(MKDIR) $(CODPATH)
+	$(COPY) yylex.cod yyparse.cod $(CODPATH)