+ make shared implemented

git-svn-id: trunk@2255 -
This commit is contained in:
florian 2006-01-11 21:20:55 +00:00
parent 5089fe99a9
commit 7dbeab548d
4 changed files with 415 additions and 329 deletions

View File

@ -1,5 +1,5 @@
# #
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/12/10] # Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/11]
# #
default: all 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-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux 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-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@ -747,6 +747,9 @@ endif
ifndef INSTALL_DATADIR ifndef INSTALL_DATADIR
INSTALL_DATADIR=$(INSTALL_BASEDIR) INSTALL_DATADIR=$(INSTALL_BASEDIR)
endif endif
ifndef INSTALL_SHAREDDIR
INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
endif
ifdef CROSSCOMPILE ifdef CROSSCOMPILE
ifndef CROSSBINDIR ifndef CROSSBINDIR
CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX)) CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
@ -798,6 +801,7 @@ ASMEXT=.s
SMARTEXT=.sl SMARTEXT=.sl
STATICLIBEXT=.a STATICLIBEXT=.a
SHAREDLIBEXT=.so SHAREDLIBEXT=.so
SHAREDLIBPREFIX=libfp
STATICLIBPREFIX=libp STATICLIBPREFIX=libp
RSTEXT=.rst RSTEXT=.rst
ifeq ($(findstring 1.0.,$(FPC_VERSION)),) ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@ -1490,9 +1494,12 @@ ifeq ($(FULL_TARGET),i386-wince)
REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1 REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1 REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_FCL=1 REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_PASJPEG=1 REQUIRE_PACKAGES_PASJPEG=1
REQUIRE_PACKAGES_NETDB=1 REQUIRE_PACKAGES_IBASE=1
REQUIRE_PACKAGES_POSTGRES=1
REQUIRE_PACKAGES_SQLITE=1
REQUIRE_PACKAGES_LIBASYNC=1 REQUIRE_PACKAGES_LIBASYNC=1
endif endif
ifeq ($(FULL_TARGET),m68k-linux) ifeq ($(FULL_TARGET),m68k-linux)
@ -1738,9 +1745,12 @@ ifeq ($(FULL_TARGET),arm-wince)
REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1 REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1 REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_FCL=1 REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_PASJPEG=1 REQUIRE_PACKAGES_PASJPEG=1
REQUIRE_PACKAGES_NETDB=1 REQUIRE_PACKAGES_IBASE=1
REQUIRE_PACKAGES_POSTGRES=1
REQUIRE_PACKAGES_SQLITE=1
REQUIRE_PACKAGES_LIBASYNC=1 REQUIRE_PACKAGES_LIBASYNC=1
endif endif
ifeq ($(FULL_TARGET),powerpc64-linux) ifeq ($(FULL_TARGET),powerpc64-linux)
@ -2203,6 +2213,14 @@ ifeq ($(FPC_VERSION),1.0.6)
override FPCOPTDEF+=HASUNIX override FPCOPTDEF+=HASUNIX
endif endif
endif endif
ifdef CREATESHARED
override FPCOPT+=-Cg
ifeq ($(CPU_TARGET),i386)
override FPCOPT+=-Aas
endif
endif
ifdef LINKSHARED
endif
ifdef GCCLIBDIR ifdef GCCLIBDIR
override FPCOPT+=-Fl$(GCCLIBDIR) override FPCOPT+=-Fl$(GCCLIBDIR)
endif endif
@ -2260,7 +2278,7 @@ ifdef TARGET_RSTS
override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS)) override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
override CLEANRSTFILES+=$(RSTFILES) override CLEANRSTFILES+=$(RSTFILES)
endif endif
.PHONY: fpc_all fpc_smart fpc_debug fpc_release .PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET) $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
@$(ECHOREDIR) Compiled > $(FPCMADE) @$(ECHOREDIR) Compiled > $(FPCMADE)
fpc_all: $(FPCMADE) fpc_all: $(FPCMADE)
@ -2301,6 +2319,35 @@ vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
vpath %$(OEXT) $(COMPILER_UNITTARGETDIR) vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR) vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
.PHONY: fpc_shared
override INSTALLTARGET+=fpc_shared_install
ifndef SHARED_LIBVERSION
SHARED_LIBVERSION=$(FPC_VERSION)
endif
ifndef SHARED_LIBNAME
SHARED_LIBNAME=$(PACKAGE_NAME)
endif
ifndef SHARED_FULLNAME
SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
endif
ifndef SHARED_LIBUNITS
SHARED_LIBUNITS:=$(TARGET_UNITS)
endif
fpc_shared:
ifdef HASSHAREDLIB
$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
ifneq ($(SHARED_BUILD),n)
$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
endif
else
@$(ECHO) Shared Libraries not supported
endif
fpc_shared_install:
ifneq ($(SHARED_BUILD),n)
ifneq ($(SHARED_LIBUNITS),)
$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
endif
endif
.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
ifdef INSTALL_UNITS ifdef INSTALL_UNITS
override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS)) override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
@ -2559,7 +2606,7 @@ smart: fpc_smart
release: fpc_release release: fpc_release
units: fpc_units units: fpc_units
examples: examples:
shared: shared: fpc_shared
install: fpc_install install: fpc_install
sourceinstall: fpc_sourceinstall sourceinstall: fpc_sourceinstall
exampleinstall: fpc_exampleinstall exampleinstall: fpc_exampleinstall

File diff suppressed because it is too large Load Diff

View File

@ -660,6 +660,10 @@ ifndef INSTALL_DATADIR
INSTALL_DATADIR=$(INSTALL_BASEDIR) INSTALL_DATADIR=$(INSTALL_BASEDIR)
endif endif
ifndef INSTALL_SHAREDDIR
INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
endif
##################################################################### #####################################################################
# Cross compile dirs # Cross compile dirs
##################################################################### #####################################################################
@ -1372,6 +1376,11 @@ endif
endif endif
ifdef LINKSHARED
#!!! deactived for testing override FPCOPT+=-XD
endif
[command_libc] [command_libc]
# Add GCC lib path if asked # Add GCC lib path if asked
ifdef GCCLIBDIR ifdef GCCLIBDIR
@ -1562,7 +1571,7 @@ fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
# General compile rules # General compile rules
##################################################################### #####################################################################
.PHONY: fpc_all fpc_smart fpc_debug fpc_release .PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET) $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
@$(ECHOREDIR) Compiled > $(FPCMADE) @$(ECHOREDIR) Compiled > $(FPCMADE)
@ -1623,23 +1632,25 @@ vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
vpath %$(OEXT) $(COMPILER_UNITTARGETDIR) vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR) vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
[libraryrules] [sharedrules]
##################################################################### #####################################################################
# Library # Library
##################################################################### #####################################################################
.PHONY: fpc_shared .PHONY: fpc_shared
override INSTALLTARGET+=fpc_shared_install
ifndef SHARED_LIBVERSION ifndef SHARED_LIBVERSION
SHARED_LIBVERSION=$(FPC_VERSION) SHARED_LIBVERSION=$(FPC_VERSION)
endif endif
ifndef $(SHARED_LIBNAME) ifndef SHARED_LIBNAME
SHARED_LIBNAME=$(PACKAGE_NAME) SHARED_LIBNAME=$(PACKAGE_NAME)
endif endif
ifndef LIB_FULLNAME ifndef SHARED_FULLNAME
SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION) SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
endif endif
# Default sharedlib units are all unit objects # Default sharedlib units are all unit objects
@ -1649,12 +1660,20 @@ endif
fpc_shared: fpc_shared:
ifdef HASSHAREDLIB ifdef HASSHAREDLIB
$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1 $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) ifneq ($(SHARED_BUILD),n)
$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
endif
else else
@$(ECHO) Shared Libraries not supported @$(ECHO) Shared Libraries not supported
endif endif
fpc_shared_install:
ifneq ($(SHARED_BUILD),n)
ifneq ($(SHARED_LIBUNITS),)
$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
endif
endif
[installrules] [installrules]
##################################################################### #####################################################################

View File

@ -24,7 +24,7 @@ interface
tsections=(sec_none, tsections=(sec_none,
sec_units,sec_exes,sec_loaders,sec_examples,sec_rsts, sec_units,sec_exes,sec_loaders,sec_examples,sec_rsts,
sec_compile,sec_install, sec_compile,sec_install,
sec_distinstall,sec_zipinstall,sec_clean,sec_libs, sec_distinstall,sec_zipinstall,sec_clean,sec_shared,
sec_command,sec_exts,sec_dirs,sec_tools,sec_info,sec_makefile sec_command,sec_exts,sec_dirs,sec_tools,sec_info,sec_makefile
); );
@ -53,7 +53,7 @@ interface
rule2sec : array[trules] of tsections=( rule2sec : array[trules] of tsections=(
sec_compile,sec_compile,sec_compile,sec_compile,sec_compile, sec_compile,sec_compile,sec_compile,sec_compile,sec_compile,
sec_examples, sec_examples,
sec_libs, sec_shared,
sec_install,sec_install,sec_install,sec_distinstall, sec_install,sec_install,sec_install,sec_distinstall,
sec_zipinstall,sec_zipinstall,sec_zipinstall,sec_zipinstall, sec_zipinstall,sec_zipinstall,sec_zipinstall,sec_zipinstall,
sec_clean,sec_clean,sec_clean, sec_clean,sec_clean,sec_clean,
@ -641,9 +641,7 @@ implementation
FHasSection[sec_zipinstall]:=false; FHasSection[sec_zipinstall]:=false;
FHasSection[sec_distinstall]:=false; FHasSection[sec_distinstall]:=false;
end; end;
{ can't get shared lib generation working without it (FK)
FHasSection[sec_libs]:=FInput.HasVariable('lib_name');
}
{ Remove unused sections for targets } { Remove unused sections for targets }
SkippedSecs:=0; SkippedSecs:=0;
if (not FInput.HasTargetVariable('target_units')) then if (not FInput.HasTargetVariable('target_units')) then
@ -673,6 +671,7 @@ implementation
generic compile rules } generic compile rules }
if SkippedSecs=4 then if SkippedSecs=4 then
begin begin
FHasSection[sec_shared]:=false;
FHasSection[sec_compile]:=false; FHasSection[sec_compile]:=false;
if (not FInput.HasTargetVariable('package_name')) and if (not FInput.HasTargetVariable('package_name')) and
(not FInput.HasTargetVariable('install_units')) and (not FInput.HasTargetVariable('install_units')) and
@ -782,9 +781,11 @@ implementation
AddTargetVariable('compiler_targetdir'); AddTargetVariable('compiler_targetdir');
AddTargetVariable('compiler_unittargetdir'); AddTargetVariable('compiler_unittargetdir');
{ shared } { shared }
AddTargetVariable('shared_libname'); AddVariable('shared_build');
AddTargetVariable('shared_libversion'); AddVariable('shared_libname');
AddTargetVariable('shared_libunits'); AddVariable('shared_libversion');
AddVariable('shared_libunits');
AddVariable('shared_build');
{ default Dirs and extensions } { default Dirs and extensions }
AddIniSection('defaultdirs'); AddIniSection('defaultdirs');
if FInput.CheckLibcRequire then if FInput.CheckLibcRequire then
@ -813,8 +814,8 @@ implementation
AddIniSection('examplerules'); AddIniSection('examplerules');
if FHasSection[sec_compile] then if FHasSection[sec_compile] then
AddIniSection('compilerules'); AddIniSection('compilerules');
if FHasSection[sec_libs] then if FHasSection[sec_shared] then
AddIniSection('libraryrules'); AddIniSection('sharedrules');
{ install } { install }
if FHasSection[sec_install] then if FHasSection[sec_install] then
AddIniSection('installrules'); AddIniSection('installrules');