8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:03:02 +01:00

Place precompiled samples of plugins into binary package according to new rules

This commit is contained in:
AlexPeshkoff 2020-04-20 18:34:28 +03:00
parent 1050a045e6
commit 1b6b717f78
4 changed files with 68 additions and 40 deletions

View File

@ -208,6 +208,12 @@ copyFiles() {
ReadOnlyTree ${TargetDir}@FB_SAMPLEDIR@
chmod 0664 ${TargetDir}@FB_SAMPLEDBDIR@/*.fdb
chmod 0755 ${TargetDir}@FB_SAMPLEDIR@/prebuilt/bin/*
#plugins samples
makeDirs ${TargetDir}@FB_SAMPLEDIR@/prebuilt
cp $BuiltFBDir/plugins/*_example.so ${TargetDir}@FB_SAMPLEDIR@/prebuilt/plugins
chmod 0644 ${TargetDir}@FB_SAMPLEDIR@/prebuilt/plugins/*
fi
#QLI help
@ -249,7 +255,7 @@ copyFiles() {
chmod 0755 ${TargetDir}@FB_LIBDIR@/*.so*
#plugins
(cd $BuiltFBDir/plugins;tar cf - .) | (cd ${TargetDir}@FB_PLUGDIR@; tar xvf -)
(cd $BuiltFBDir/plugins;tar cf - --exclude='*_example.so' .) | (cd ${TargetDir}@FB_PLUGDIR@; tar xvf -)
for file in `find ${TargetDir}@FB_PLUGDIR@ -name '*.so*' -print`; do
chmod 0755 ${file}

View File

@ -28,7 +28,7 @@
#
#
#
ROOT=../..
ROOT=$(shell cd ../..; pwd)
# Add the install include directory to the search path since the
# examples need to build using those headers values.
@ -64,7 +64,7 @@ LIB_LINK_MAPFILE =
EXAMPLES_DEST= $(GEN_ROOT)/examples
EXAMPLES_SRC= $(ROOT)/examples
EXAMPLES_FB= $(FIREBIRD)/examples
EMPBLD_Objects= $(EXAMPLES_DEST)/empbuild.o
@ -79,37 +79,44 @@ INTL_Files = intlddl.sql intldml.sql indexoff.sql indexon.sql \
INTL_Sources = $(addprefix $(EXAMPLES_DEST)/, $(INTL_Files))
EMPLOYEE_DB= $(EXAMPLES_DEST)/employee.fdb
FINAL_EMPDB= $(FIREBIRD)/examples/empbuild/employee.fdb
FINAL_EMPDB= $(EXAMPLES_FB)/empbuild/employee.fdb
INTLEMP_DB= $(EXAMPLES_DEST)/intlemp.fdb
EXTAUTH_PLUGIN= $(EXAMPLES_FB)/prebuilt/libExtAuth.$(SHRLIB_EXT)
.PHONY: all examples
all: examples
# examples: $(EMPLOYEE_DB) $(INTLEMP_DB) $(FIREBIRD)/examples/README
examples: $(FINAL_EMPDB) $(FIREBIRD)/examples/README
# examples: $(EMPLOYEE_DB) $(INTLEMP_DB) $(EXAMPLES_FB)/README
examples: $(FINAL_EMPDB) $(EXAMPLES_FB)/README $(EXTAUTH_PLUGIN)
$(EXTAUTH_PLUGIN): $(EXAMPLES_FB)/extauth/Makefile
make -C $(EXAMPLES_FB)/extauth OUT=$(EXAMPLES_FB)/prebuilt INTERMED=$(TMP_ROOT)/examples/extauth
$(EXAMPLES_FB)/extauth/Makefile:
ifeq ($(TOMCRYPT_BUILD_FLG),Y)
mkdir -p $(EXAMPLES_FB)/extauth/tomcrypt.include
$(CP) $(ROOT)/extern/libtomcrypt/src/headers/* $(EXAMPLES_FB)/extauth/tomcrypt.include
endif
tar cf - -C $(ROOT)/examples/extauth . | tar xf - -C $(EXAMPLES_FB)/extauth/
$(FINAL_EMPDB): $(EMPLOYEE_DB)
$(RM) $(FINAL_EMPDB)
$(CP) $(EMPLOYEE_DB) $(FINAL_EMPDB)
$(FIREBIRD)/examples/README:
$(CP) $(ROOT)/examples/readme $(FIREBIRD)/examples/README
$(CP) $(ROOT)/examples/*.* $(FIREBIRD)/examples/
$(CP) $(ROOT)/examples/api/*.* $(FIREBIRD)/examples/api/
$(CP) $(ROOT)/examples/dbcrypt/*.* $(FIREBIRD)/examples/dbcrypt/
$(CP) -r $(ROOT)/examples/extauth/* $(FIREBIRD)/examples/extauth/
ifeq ($(TOMCRYPT_BUILD_FLG),Y)
mkdir -p $(FIREBIRD)/examples/extauth/tomcrypt.include
$(CP) $(ROOT)/extern/libtomcrypt/src/headers/* $(FIREBIRD)/examples/extauth/tomcrypt.include
endif
$(CP) $(ROOT)/examples/include/*.* $(FIREBIRD)/examples/include/
$(CP) $(ROOT)/examples/interfaces/*.* $(FIREBIRD)/examples/interfaces/
$(CP) $(ROOT)/examples/package/*.* $(FIREBIRD)/examples/package/
$(CP) $(ROOT)/examples/stat/*.* $(FIREBIRD)/examples/stat/
$(CP) $(ROOT)/examples/udf/*.* $(FIREBIRD)/examples/udf/
$(CP) $(ROOT)/examples/udr/*.* $(FIREBIRD)/examples/udr/
# $(CP) intlemp.fdb $(FIREBIRD)/examples/empbuild/
$(EXAMPLES_FB)/README:
$(CP) $(ROOT)/examples/*.* $(EXAMPLES_FB)/
$(CP) $(ROOT)/examples/api/*.* $(EXAMPLES_FB)/api/
$(CP) $(ROOT)/examples/dbcrypt/*.* $(EXAMPLES_FB)/dbcrypt/
$(CP) $(ROOT)/examples/include/*.* $(EXAMPLES_FB)/include/
$(CP) $(ROOT)/examples/interfaces/*.* $(EXAMPLES_FB)/interfaces/
$(CP) $(ROOT)/examples/package/*.* $(EXAMPLES_FB)/package/
$(CP) $(ROOT)/examples/stat/*.* $(EXAMPLES_FB)/stat/
$(CP) $(ROOT)/examples/udf/*.* $(EXAMPLES_FB)/udf/
$(CP) $(ROOT)/examples/udr/*.* $(EXAMPLES_FB)/udr/
# $(CP) intlemp.fdb $(EXAMPLES_FB)/empbuild/
$(CP) $(ROOT)/examples/readme $(EXAMPLES_FB)/README
$(EXAMPLES_DEST)% : $(EXAMPLES_SRC)%
$(CP) $^ $@

View File

@ -1204,15 +1204,10 @@ for fb_tgt in \$FB_TARGETS; do
echo "Creating \$fb_tgt directories"
dnl ### GEN ### directories for databases and misc
mkdir -p gen/\$fb_tgt/examples
mkdir -p gen/\$fb_tgt/refDatabases
dnl # output
mkdir -p gen/\$fb_tgt/include
mkdir -p gen/\$fb_tgt/intl
mkdir -p gen/\$fb_tgt/firebird/bin
mkdir -p gen/\$fb_tgt/firebird/plugins
mkdir -p gen/\$fb_tgt/firebird/plugins/udr
mkdir -p gen/\$fb_tgt/firebird/examples/api
mkdir -p gen/\$fb_tgt/firebird/examples/dbcrypt
mkdir -p gen/\$fb_tgt/firebird/examples/empbuild
@ -1223,10 +1218,11 @@ dnl # output
mkdir -p gen/\$fb_tgt/firebird/examples/stat
mkdir -p gen/\$fb_tgt/firebird/examples/udf
mkdir -p gen/\$fb_tgt/firebird/examples/udr
mkdir -p gen/\$fb_tgt/firebird/examples/prebuilt/bin
mkdir -p gen/\$fb_tgt/firebird/examples/prebuilt/plugins
mkdir -p gen/\$fb_tgt/firebird/lib
mkdir -p gen/\$fb_tgt/firebird/misc
mkdir -p gen/\$fb_tgt/firebird/help
mkdir -p gen/\$fb_tgt/firebird/plugins/udr
dnl ### TEMP ### directories for generated .cpp, .o and .d by module name
for src_dir in `cd src; ls -R -1 * | grep : | tr -d : | tr "\n" " "; cd ..`; do

View File

@ -18,7 +18,9 @@
# All Rights Reserved.
# Contributor(s): ______________________________________.
ifndef ROOT
ROOT=../..
endif
#ROOT=$(shell cd ../..; pwd)
PLUGINS=$(ROOT)/plugins
@ -28,7 +30,17 @@ LIB=$(ROOT)/lib
LIB_PREFIX=lib
SHRLIB_EXT=so
makePluginName=$(PLUGINS)/$(LIB_PREFIX)$(1).$(SHRLIB_EXT)
ifndef INTERMED
INTERMED=.
endif
ifdef OUT
OUT_BIN=$(OUT)/bin
OUT_PLUG=$(OUT)/plugins
else
OUT_BIN=.
OUT_PLUG=.
endif
TOMCRYPT_COMPILE=-DLTC_PTHREAD -DUSE_LTM -DLTM_DESC
OwnInclude=$(shell [ -d tomcrypt.include ] && echo Yes || echo No)
@ -36,14 +48,18 @@ ifeq ($(OwnInclude), Yes)
TOMCRYPT_COMPILE += -Itomcrypt.include
TOMCRYPT_LINK=-L$(LIB)/.tm
endif
BLD_SIMPLE_KEY_AUTH=libExtAuth.so
SIMPLE_KEY_AUTH=$(call makePluginName,ExtAuth)
BLD_KEYGEN=extauth_keygen
KEYGEN=$(BIN)/$(BLD_KEYGEN)
KEYGEN_objects=keygen.o
TCWRAP_objects=TcWrapper.o
KEY_AUTH_objects=ExtAuth.o
SIMPLE_KEY_AUTH_NAME=$(LIB_PREFIX)ExtAuth.$(SHRLIB_EXT)
BLD_SIMPLE_KEY_AUTH=$(OUT_PLUG)/$(SIMPLE_KEY_AUTH_NAME)
SIMPLE_KEY_AUTH=$(PLUGINS)/$(SIMPLE_KEY_AUTH_NAME)
KEYGEN_NAME=extauth_keygen
BLD_KEYGEN=$(OUT_BIN)/$(KEYGEN_NAME)
KEYGEN=$(BIN)/$(KEYGEN_NAME)
KEYGEN_objects=$(INTERMED)/keygen.o
TCWRAP_objects=$(INTERMED)/TcWrapper.o
KEY_AUTH_objects=$(INTERMED)/ExtAuth.o
CXXFLAGS=-std=c++11 -pthread -I$(ROOT)/include -fPIC $(TOMCRYPT_COMPILE)
LDFLAGS=-pthread -L$(LIB) -Wl,-rpath,'$$ORIGIN/../lib' $(TOMCRYPT_LINK)
@ -51,6 +67,9 @@ LDFLAGS=-pthread -L$(LIB) -Wl,-rpath,'$$ORIGIN/../lib' $(TOMCRYPT_LINK)
LINK=c++
LINK_LIBS=-lfbclient -ltomcrypt
$(INTERMED)/%.o: ./%.cpp
$(CXX) $(CXXFLAGS) -c $(firstword $<) -o $@
.PHONY: all keygen plugin install
all: keygen plugin
@ -66,7 +85,7 @@ $(BLD_SIMPLE_KEY_AUTH): $(KEY_AUTH_objects) $(TCWRAP_objects)
$(LINK) -shared $(LDFLAGS) $^ -o $@ $(LINK_LIBS)
clean:
rm -f *.o* $(BLD_KEYGEN) $(BLD_SIMPLE_KEY_AUTH)
rm -f $(INTERMED)/*.o* $(BLD_KEYGEN) $(BLD_SIMPLE_KEY_AUTH)
install: $(SIMPLE_KEY_AUTH) $(KEYGEN)