Index: packages/fcl-db/Makefile
===================================================================
--- packages/fcl-db/Makefile	(revision 9420)
+++ packages/fcl-db/Makefile	(working copy)
@@ -1,12 +1,11 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/05/03]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
-OSNeedsComspecToRunBatch = go32v2 watcom
 FORCE:
 .PHONY: FORCE
 override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
@@ -57,11 +56,6 @@
 SRCBATCHEXT=.bat
 endif
 endif
-ifdef COMSPEC
-ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
-RUNBATCH=$(COMSPEC) /C
-endif
-endif
 ifdef inUnix
 PATHSEP=/
 else
@@ -108,11 +102,7 @@
 FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(FPCPROG),)
 FPCPROG:=$(firstword $(FPCPROG))
-ifneq ($(CPU_TARGET),)
-FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
-else
 FPC:=$(shell $(FPCPROG) -PB)
-endif
 ifneq ($(findstring Error,$(FPC)),)
 override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
 endif
@@ -243,13 +233,13 @@
 override PACKAGE_NAME=fcl-db
 override PACKAGE_VERSION=2.0.0
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
@@ -291,7 +281,7 @@
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
@@ -300,7 +290,7 @@
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite
@@ -324,7 +314,7 @@
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite
@@ -345,7 +335,7 @@
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite
@@ -357,28 +347,25 @@
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite
 endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite
-endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
@@ -393,7 +380,7 @@
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict
+override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite src/export src/datadict src/codegen
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 override TARGET_DIRS+=src/sdf src/memds src/sqldb src/base  src/dbase src/sqlite
@@ -522,9 +509,6 @@
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2h
 endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override COMPILER_OPTIONS+=-S2h
-endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 override COMPILER_OPTIONS+=-S2h
 endif
@@ -1568,15 +1552,6 @@
 REQUIRE_PACKAGES_ORACLE=1
 REQUIRE_PACKAGES_SQLITE=1
 endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-REQUIRE_PACKAGES_FCL-BASE=1
-REQUIRE_PACKAGES_IBASE=1
-REQUIRE_PACKAGES_POSTGRES=1
-REQUIRE_PACKAGES_MYSQL=1
-REQUIRE_PACKAGES_ODBC=1
-REQUIRE_PACKAGES_ORACLE=1
-REQUIRE_PACKAGES_SQLITE=1
-endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 REQUIRE_PACKAGES_WINUNITS=1
 REQUIRE_PACKAGES_FCL-BASE=1
@@ -1861,7 +1836,7 @@
 endif
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
-override FPCOPT+=-XP$(BINUTILSPREFIX)
+override FPCOPT+=-XP$(BINUTILSPREFIX) 
 endif
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-Xr$(RLINKPATH)
@@ -1999,13 +1974,9 @@
 EXECPPAS=
 else
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
-ifdef RUNBATCH
-EXECPPAS:=@$(RUNBATCH) $(PPAS)
-else
 EXECPPAS:=@$(PPAS)
 endif
 endif
-endif
 ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
@@ -2147,12 +2118,8 @@
 ifdef inUnix
 	/bin/sh $(ZIPWRAPPER)
 else
-ifdef RUNBATCH
-	$(RUNBATCH) (ZIPWRAPPER)
-else
 	$(ZIPWRAPPER)
 endif
-endif
 	$(DEL) $(ZIPWRAPPER)
 else
 	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
@@ -2348,6 +2315,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 TARGET_DIRS_SRC/SDF=1
@@ -2364,6 +2332,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 TARGET_DIRS_SRC/SDF=1
@@ -2462,6 +2431,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 TARGET_DIRS_SRC/SDF=1
@@ -2484,6 +2454,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 TARGET_DIRS_SRC/SDF=1
@@ -2542,6 +2513,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 TARGET_DIRS_SRC/SDF=1
@@ -2592,6 +2564,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 TARGET_DIRS_SRC/SDF=1
@@ -2624,6 +2597,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 TARGET_DIRS_SRC/SDF=1
@@ -2633,14 +2607,6 @@
 TARGET_DIRS_SRC/DBASE=1
 TARGET_DIRS_SRC/SQLITE=1
 endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-TARGET_DIRS_SRC/SDF=1
-TARGET_DIRS_SRC/MEMDS=1
-TARGET_DIRS_SRC/SQLDB=1
-TARGET_DIRS_SRC/BASE=1
-TARGET_DIRS_SRC/DBASE=1
-TARGET_DIRS_SRC/SQLITE=1
-endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 TARGET_DIRS_SRC/SDF=1
 TARGET_DIRS_SRC/MEMDS=1
@@ -2649,6 +2615,7 @@
 TARGET_DIRS_SRC/DBASE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 TARGET_DIRS_SRC/SDF=1
@@ -2665,6 +2632,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 TARGET_DIRS_SRC/SDF=1
@@ -2681,6 +2649,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 TARGET_DIRS_SRC/SDF=1
@@ -2715,6 +2684,7 @@
 TARGET_DIRS_SRC/SQLITE=1
 TARGET_DIRS_SRC/EXPORT=1
 TARGET_DIRS_SRC/DATADICT=1
+TARGET_DIRS_SRC/CODEGEN=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 TARGET_DIRS_SRC/SDF=1
@@ -3090,6 +3060,51 @@
 	$(MAKE) -C src/datadict all
 .PHONY: src/datadict_all src/datadict_debug src/datadict_smart src/datadict_release src/datadict_units src/datadict_examples src/datadict_shared src/datadict_install src/datadict_sourceinstall src/datadict_exampleinstall src/datadict_distinstall src/datadict_zipinstall src/datadict_zipsourceinstall src/datadict_zipexampleinstall src/datadict_zipdistinstall src/datadict_clean src/datadict_distclean src/datadict_cleanall src/datadict_info src/datadict_makefiles src/datadict
 endif
+ifdef TARGET_DIRS_SRC/CODEGEN
+src/codegen_all:
+	$(MAKE) -C src/codegen all
+src/codegen_debug:
+	$(MAKE) -C src/codegen debug
+src/codegen_smart:
+	$(MAKE) -C src/codegen smart
+src/codegen_release:
+	$(MAKE) -C src/codegen release
+src/codegen_units:
+	$(MAKE) -C src/codegen units
+src/codegen_examples:
+	$(MAKE) -C src/codegen examples
+src/codegen_shared:
+	$(MAKE) -C src/codegen shared
+src/codegen_install:
+	$(MAKE) -C src/codegen install
+src/codegen_sourceinstall:
+	$(MAKE) -C src/codegen sourceinstall
+src/codegen_exampleinstall:
+	$(MAKE) -C src/codegen exampleinstall
+src/codegen_distinstall:
+	$(MAKE) -C src/codegen distinstall
+src/codegen_zipinstall:
+	$(MAKE) -C src/codegen zipinstall
+src/codegen_zipsourceinstall:
+	$(MAKE) -C src/codegen zipsourceinstall
+src/codegen_zipexampleinstall:
+	$(MAKE) -C src/codegen zipexampleinstall
+src/codegen_zipdistinstall:
+	$(MAKE) -C src/codegen zipdistinstall
+src/codegen_clean:
+	$(MAKE) -C src/codegen clean
+src/codegen_distclean:
+	$(MAKE) -C src/codegen distclean
+src/codegen_cleanall:
+	$(MAKE) -C src/codegen cleanall
+src/codegen_info:
+	$(MAKE) -C src/codegen info
+src/codegen_makefiles:
+	$(MAKE) -C src/codegen makefiles
+src/codegen:
+	$(MAKE) -C src/codegen all
+.PHONY: src/codegen_all src/codegen_debug src/codegen_smart src/codegen_release src/codegen_units src/codegen_examples src/codegen_shared src/codegen_install src/codegen_sourceinstall src/codegen_exampleinstall src/codegen_distinstall src/codegen_zipinstall src/codegen_zipsourceinstall src/codegen_zipexampleinstall src/codegen_zipdistinstall src/codegen_clean src/codegen_distclean src/codegen_cleanall src/codegen_info src/codegen_makefiles src/codegen
+endif
 all: $(addsuffix _all,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
Index: packages/fcl-db/Makefile.fpc
===================================================================
--- packages/fcl-db/Makefile.fpc	(revision 9420)
+++ packages/fcl-db/Makefile.fpc	(working copy)
@@ -8,15 +8,15 @@
 
 [target]
 dirs=src/sdf src/memds src/sqldb src/base 
-dirs_linux=src/dbase src/sqlite src/export src/datadict
+dirs_linux=src/dbase src/sqlite src/export src/datadict src/codegen
 dirs_freebsd=src/dbase src/sqlite
 dirs_darwin=src/dbase src/sqlite
 dirs_solaris=src/dbase src/sqlite
 dirs_netbsd=src/dbase src/sqlite
 dirs_openbsd=src/dbase src/sqlite
-dirs_win32=src/dbase src/sqlite src/export src/datadict
-dirs_win64=src/dbase src/export src/datadict
-dirs_wince=src/dbase src/sqlite src/export src/datadict
+dirs_win32=src/dbase src/sqlite src/export src/datadict src/codegen
+dirs_win64=src/dbase src/export src/datadict src/codegen
+dirs_wince=src/dbase src/sqlite src/export src/datadict src/codegen
 
 [require]
 packages=fcl-base
