Add build setup for static library

This commit is contained in:
Renaud Casenave-Péré 2021-03-21 20:53:55 +01:00
parent 9675b68f6d
commit 1c56565a5f
12 changed files with 105 additions and 14 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
*.a *.a
*.prl
*.dll *.dll
*.dylib *.dylib
*.exe *.exe

View file

@ -2442,10 +2442,13 @@ cl_object qrequire2(cl_object l_name, cl_object l_quiet) { /// qrequire
path = appPath + "/../libs/"; } path = appPath + "/../libs/"; }
#endif #endif
#ifdef STATIC_MODULES #ifdef STATIC_MODULES
#ifndef OS_SAILFISH
if("help" == name) { if("help" == name) {
if(!ModuleInterface::help) { if(!ModuleInterface::help) {
ModuleInterface::help = new ModuleHelp; }} ModuleInterface::help = new ModuleHelp; }}
else if("multimedia" == name) { else
#endif
if("multimedia" == name) {
if(!ModuleInterface::multimedia) { if(!ModuleInterface::multimedia) {
ModuleInterface::multimedia = new ModuleMultimedia; }} ModuleInterface::multimedia = new ModuleMultimedia; }}
else if("network" == name) { else if("network" == name) {
@ -2457,6 +2460,7 @@ cl_object qrequire2(cl_object l_name, cl_object l_quiet) { /// qrequire
else if("sql" == name) { else if("sql" == name) {
if(!ModuleInterface::sql) { if(!ModuleInterface::sql) {
ModuleInterface::sql = new ModuleSql; }} ModuleInterface::sql = new ModuleSql; }}
#ifndef OS_SAILFISH
else if("svg" == name) { else if("svg" == name) {
if(!ModuleInterface::svg) { if(!ModuleInterface::svg) {
ModuleInterface::svg = new ModuleSvg; }} ModuleInterface::svg = new ModuleSvg; }}
@ -2467,6 +2471,7 @@ cl_object qrequire2(cl_object l_name, cl_object l_quiet) { /// qrequire
else if("webkit" == name) { else if("webkit" == name) {
if(!ModuleInterface::webkit) { if(!ModuleInterface::webkit) {
ModuleInterface::webkit = new ModuleWebkit; }} */ ModuleInterface::webkit = new ModuleWebkit; }} */
#endif
else if(l_quiet == ECL_NIL) { else if(l_quiet == ECL_NIL) {
error_msg("QREQUIRE", LIST1(l_name)); } error_msg("QREQUIRE", LIST1(l_name)); }
return l_name; return l_name;

View file

@ -8,6 +8,7 @@ TARGET = eql5
DESTDIR = ../ DESTDIR = ../
OBJECTS_DIR = ./tmp/ OBJECTS_DIR = ./tmp/
MOC_DIR = ./tmp/ MOC_DIR = ./tmp/
VERSION = $$(EQL_VERSION)
# static modules (optional) *** warning: only use them if you know what you are doing! *** # static modules (optional) *** warning: only use them if you know what you are doing! ***
#DEFINES += STATIC_MODULES #DEFINES += STATIC_MODULES
@ -45,11 +46,28 @@ win32 {
sailfish { sailfish {
# on Sailfish run this prior to run qmake: # on Sailfish run this prior to run qmake:
# $ export SAILFISH=sailfish # $ export SAILFISH=sailfish
QT -= printsupport uitools QT -= printsupport uitools
CONFIG -= dll
CONFIG += shared_and_static build_all
DEFINES += OS_SAILFISH DEFINES += OS_SAILFISH
message("*** Building for SailfishOS ***") message("*** Building for SailfishOS ***")
} }
static {
CONFIG += create_prl
DEFINES += STATIC_MODULES
QT += qml multimedia network quick sql
DESTDIR = ./
OBJECTS_DIR = ./tmp/static/
MOC_DIR = ./tmp/static/
combinedlib.files = libeql5.a libeql5.prl
combinedlib.extra = ecl -shell make-static.lisp
combinedlib.path = $$[QT_INSTALL_LIBS]
INSTALLS = combinedlib
}
HEADERS += gen/_lobjects.h \ HEADERS += gen/_lobjects.h \
gen/_main_q_classes.h \ gen/_main_q_classes.h \
gen/_main_n_classes.h \ gen/_main_n_classes.h \

3
src/make-static.lisp Normal file
View file

@ -0,0 +1,3 @@
(let* ((static-libs (mapcar #'file-namestring (directory "libeql5_*.a")))
(mri (format nil "create libeql5static.a~%addlib libini_eql5.a~%addlib libeql5.a~%~{addlib ~a~%~}save~%end~%" static-libs)))
(ext:system (format nil "sh -c 'echo ~s | ar -M && mv libeql5static.a libeql5.a'" mri)))

View file

@ -2,13 +2,13 @@ QT += help printsupport uitools
TEMPLATE = lib TEMPLATE = lib
CONFIG += no_keywords release $$(SAILFISH) CONFIG += no_keywords release $$(SAILFISH)
CONFIG += plugin CONFIG += plugin
#CONFIG += static
INCLUDEPATH += ../src /usr/local/include INCLUDEPATH += ../src /usr/local/include
LIBS += -lecl -leql5 -L.. -L/usr/local/lib LIBS += -lecl -leql5 -L.. -L/usr/local/lib
TARGET = eql5_help TARGET = eql5_help
DESTDIR = ../ DESTDIR = ../
OBJECTS_DIR = ./tmp/help/ OBJECTS_DIR = ./tmp/help/
MOC_DIR = ./tmp/help/ MOC_DIR = ./tmp/help/
VERSION = $$(EQL_VERSION)
linux { linux {
target.path = $$[QT_INSTALL_LIBS] target.path = $$[QT_INSTALL_LIBS]
@ -27,11 +27,19 @@ win32 {
sailfish { sailfish {
# on Sailfish run this prior to run qmake: # on Sailfish run this prior to run qmake:
# $ export SAILFISH=sailfish # $ export SAILFISH=sailfish
QT -= printsupport uitools QT -= printsupport uitools
CONFIG += shared_and_static build_all
DEFINES += OS_SAILFISH DEFINES += OS_SAILFISH
message("*** Building for SailfishOS ***") message("*** Building for SailfishOS ***")
} }
static {
DESTDIR = ./
OBJECTS_DIR = ./tmp/static/help/
MOC_DIR = ./tmp/static/help/
INSTALLS -= target
}
HEADERS += gen/help/_ini.h \ HEADERS += gen/help/_ini.h \
gen/help/_ini2.h \ gen/help/_ini2.h \
gen/help/_q_classes.h \ gen/help/_q_classes.h \

View file

@ -2,13 +2,13 @@ QT += multimedia multimediawidgets printsupport uitools
TEMPLATE = lib TEMPLATE = lib
CONFIG += no_keywords release $$(SAILFISH) CONFIG += no_keywords release $$(SAILFISH)
CONFIG += plugin CONFIG += plugin
#CONFIG += static
INCLUDEPATH += ../src /usr/local/include INCLUDEPATH += ../src /usr/local/include
LIBS += -lecl -leql5 -L.. -L/usr/local/lib LIBS += -lecl -leql5 -L.. -L/usr/local/lib
TARGET = eql5_multimedia TARGET = eql5_multimedia
DESTDIR = ../ DESTDIR = ../
OBJECTS_DIR = ./tmp/multimedia/ OBJECTS_DIR = ./tmp/multimedia/
MOC_DIR = ./tmp/multimedia/ MOC_DIR = ./tmp/multimedia/
VERSION = $$(EQL_VERSION)
linux { linux {
target.path = $$[QT_INSTALL_LIBS] target.path = $$[QT_INSTALL_LIBS]
@ -29,10 +29,18 @@ sailfish {
# $ export SAILFISH=sailfish # $ export SAILFISH=sailfish
QT -= multimediawidgets printsupport uitools QT -= multimediawidgets printsupport uitools
QT += widgets QT += widgets
CONFIG += shared_and_static build_all
DEFINES += OS_SAILFISH DEFINES += OS_SAILFISH
message("*** Building for SailfishOS ***") message("*** Building for SailfishOS ***")
} }
static {
DESTDIR = ./
OBJECTS_DIR = ./tmp/static/multimedia/
MOC_DIR = ./tmp/static/multimedia/
INSTALLS -= target
}
HEADERS += gen/multimedia/_ini.h \ HEADERS += gen/multimedia/_ini.h \
gen/multimedia/_ini2.h \ gen/multimedia/_ini2.h \
gen/multimedia/_q_classes.h \ gen/multimedia/_q_classes.h \

View file

@ -2,13 +2,13 @@ QT += network printsupport uitools
TEMPLATE = lib TEMPLATE = lib
CONFIG += no_keywords release $$(SAILFISH) CONFIG += no_keywords release $$(SAILFISH)
CONFIG += plugin CONFIG += plugin
#CONFIG += static
INCLUDEPATH += ../src /usr/local/include INCLUDEPATH += ../src /usr/local/include
LIBS += -lecl -leql5 -L.. -L/usr/local/lib LIBS += -lecl -leql5 -L.. -L/usr/local/lib
TARGET = eql5_network TARGET = eql5_network
DESTDIR = ../ DESTDIR = ../
OBJECTS_DIR = ./tmp/network/ OBJECTS_DIR = ./tmp/network/
MOC_DIR = ./tmp/network/ MOC_DIR = ./tmp/network/
VERSION = $$(EQL_VERSION)
linux { linux {
target.path = $$[QT_INSTALL_LIBS] target.path = $$[QT_INSTALL_LIBS]
@ -29,10 +29,18 @@ sailfish {
# $ export SAILFISH=sailfish # $ export SAILFISH=sailfish
QT -= printsupport uitools QT -= printsupport uitools
QT += widgets QT += widgets
CONFIG += shared_and_static build_all
DEFINES += OS_SAILFISH DEFINES += OS_SAILFISH
message("*** Building for SailfishOS ***") message("*** Building for SailfishOS ***")
} }
static {
DESTDIR = ./
OBJECTS_DIR = ./tmp/static/network/
MOC_DIR = ./tmp/static/network/
INSTALLS -= target
}
HEADERS += gen/network/_ini.h \ HEADERS += gen/network/_ini.h \
gen/network/_ini2.h \ gen/network/_ini2.h \
gen/network/_q_classes.h \ gen/network/_q_classes.h \

View file

@ -2,13 +2,13 @@ QT += quick quickwidgets qml printsupport uitools
TEMPLATE = lib TEMPLATE = lib
CONFIG += no_keywords release $$(SAILFISH) CONFIG += no_keywords release $$(SAILFISH)
CONFIG += plugin CONFIG += plugin
#CONFIG += static
INCLUDEPATH += ../src /usr/local/include INCLUDEPATH += ../src /usr/local/include
LIBS += -lecl -leql5 -L.. -L/usr/local/lib LIBS += -lecl -leql5 -L.. -L/usr/local/lib
TARGET = eql5_quick TARGET = eql5_quick
DESTDIR = ../ DESTDIR = ../
OBJECTS_DIR = ./tmp/quick/ OBJECTS_DIR = ./tmp/quick/
MOC_DIR = ./tmp/quick/ MOC_DIR = ./tmp/quick/
VERSION = $$(EQL_VERSION)
linux { linux {
target.path = $$[QT_INSTALL_LIBS] target.path = $$[QT_INSTALL_LIBS]
@ -29,10 +29,18 @@ sailfish {
# $ export SAILFISH=sailfish # $ export SAILFISH=sailfish
QT -= quickwidgets printsupport uitools QT -= quickwidgets printsupport uitools
QT += widgets QT += widgets
CONFIG += shared_and_static build_all
DEFINES += OS_SAILFISH DEFINES += OS_SAILFISH
message("*** Building for SailfishOS ***") message("*** Building for SailfishOS ***")
} }
static {
DESTDIR = ./
OBJECTS_DIR = ./tmp/static/quick/
MOC_DIR = ./tmp/static/quick/
INSTALLS -= target
}
HEADERS += gen/quick/_ini.h \ HEADERS += gen/quick/_ini.h \
gen/quick/_ini2.h \ gen/quick/_ini2.h \
gen/quick/_q_classes.h \ gen/quick/_q_classes.h \

View file

@ -2,13 +2,13 @@ QT += sql printsupport uitools
TEMPLATE = lib TEMPLATE = lib
CONFIG += no_keywords release $$(SAILFISH) CONFIG += no_keywords release $$(SAILFISH)
CONFIG += plugin CONFIG += plugin
#CONFIG += static
INCLUDEPATH += ../src /usr/local/include INCLUDEPATH += ../src /usr/local/include
LIBS += -lecl -leql5 -L.. -L/usr/local/lib LIBS += -lecl -leql5 -L.. -L/usr/local/lib
TARGET = eql5_sql TARGET = eql5_sql
DESTDIR = ../ DESTDIR = ../
OBJECTS_DIR = ./tmp/sql/ OBJECTS_DIR = ./tmp/sql/
MOC_DIR = ./tmp/sql/ MOC_DIR = ./tmp/sql/
VERSION = $$(EQL_VERSION)
linux { linux {
target.path = $$[QT_INSTALL_LIBS] target.path = $$[QT_INSTALL_LIBS]
@ -29,10 +29,18 @@ sailfish {
# $ export SAILFISH=sailfish # $ export SAILFISH=sailfish
QT -= printsupport uitools QT -= printsupport uitools
QT += widgets QT += widgets
CONFIG += shared_and_static build_all
DEFINES += OS_SAILFISH DEFINES += OS_SAILFISH
message("*** Building for SailfishOS ***") message("*** Building for SailfishOS ***")
} }
static {
DESTDIR = ./
OBJECTS_DIR = ./tmp/static/sql/
MOC_DIR = ./tmp/static/sql/
INSTALLS -= target
}
HEADERS += gen/sql/_ini.h \ HEADERS += gen/sql/_ini.h \
gen/sql/_ini2.h \ gen/sql/_ini2.h \
gen/sql/_q_classes.h \ gen/sql/_q_classes.h \

View file

@ -2,13 +2,13 @@ QT += svg printsupport uitools
TEMPLATE = lib TEMPLATE = lib
CONFIG += no_keywords release $$(SAILFISH) CONFIG += no_keywords release $$(SAILFISH)
CONFIG += plugin CONFIG += plugin
#CONFIG += static
INCLUDEPATH += ../src /usr/local/include INCLUDEPATH += ../src /usr/local/include
LIBS += -lecl -leql5 -L.. -L/usr/local/lib LIBS += -lecl -leql5 -L.. -L/usr/local/lib
TARGET = eql5_svg TARGET = eql5_svg
DESTDIR = ../ DESTDIR = ../
OBJECTS_DIR = ./tmp/svg/ OBJECTS_DIR = ./tmp/svg/
MOC_DIR = ./tmp/svg/ MOC_DIR = ./tmp/svg/
VERSION = $$(EQL_VERSION)
linux { linux {
target.path = $$[QT_INSTALL_LIBS] target.path = $$[QT_INSTALL_LIBS]
@ -27,11 +27,19 @@ win32 {
sailfish { sailfish {
# on Sailfish run this prior to run qmake: # on Sailfish run this prior to run qmake:
# $ export SAILFISH=sailfish # $ export SAILFISH=sailfish
QT -= printsupport uitools QT -= printsupport uitools
CONFIG += shared_and_static build_all
DEFINES += OS_SAILFISH DEFINES += OS_SAILFISH
message("*** Building for SailfishOS ***") message("*** Building for SailfishOS ***")
} }
static {
DESTDIR = ./
OBJECTS_DIR = ./tmp/static/svg/
MOC_DIR = ./tmp/static/svg/
INSTALLS -= target
}
HEADERS += gen/svg/_ini.h \ HEADERS += gen/svg/_ini.h \
gen/svg/_ini2.h \ gen/svg/_ini2.h \
gen/svg/_q_classes.h \ gen/svg/_q_classes.h \

View file

@ -2,13 +2,13 @@ QT += webengine webenginewidgets printsupport uitools
TEMPLATE = lib TEMPLATE = lib
CONFIG += no_keywords release $$(SAILFISH) CONFIG += no_keywords release $$(SAILFISH)
CONFIG += plugin CONFIG += plugin
#CONFIG += static
INCLUDEPATH += ../src /usr/local/include INCLUDEPATH += ../src /usr/local/include
LIBS += -lecl -leql5 -L.. -L/usr/local/lib LIBS += -lecl -leql5 -L.. -L/usr/local/lib
TARGET = eql5_webengine TARGET = eql5_webengine
DESTDIR = ../ DESTDIR = ../
OBJECTS_DIR = ./tmp/webengine/ OBJECTS_DIR = ./tmp/webengine/
MOC_DIR = ./tmp/webengine/ MOC_DIR = ./tmp/webengine/
VERSION = $$(EQL_VERSION)
linux { linux {
target.path = $$[QT_INSTALL_LIBS] target.path = $$[QT_INSTALL_LIBS]
@ -29,11 +29,19 @@ win32 {
sailfish { sailfish {
# on Sailfish run this prior to run qmake: # on Sailfish run this prior to run qmake:
# $ export SAILFISH=sailfish # $ export SAILFISH=sailfish
QT -= printsupport uitools QT -= printsupport uitools
CONFIG += shared_and_static build_all
DEFINES += OS_SAILFISH DEFINES += OS_SAILFISH
message("*** Building for SailfishOS ***") message("*** Building for SailfishOS ***")
} }
static {
DESTDIR = ./
OBJECTS_DIR = ./tmp/static/webengine/
MOC_DIR = ./tmp/static/webengine/
INSTALLS -= target
}
HEADERS += gen/webengine/_ini.h \ HEADERS += gen/webengine/_ini.h \
gen/webengine/_ini2.h \ gen/webengine/_ini2.h \
gen/webengine/_q_classes.h \ gen/webengine/_q_classes.h \

View file

@ -2,13 +2,13 @@ QT += webkit webkitwidgets printsupport uitools
TEMPLATE = lib TEMPLATE = lib
CONFIG += no_keywords release $$(SAILFISH) CONFIG += no_keywords release $$(SAILFISH)
CONFIG += plugin CONFIG += plugin
#CONFIG += static
INCLUDEPATH += ../src /usr/local/include INCLUDEPATH += ../src /usr/local/include
LIBS += -lecl -leql5 -L.. -L/usr/local/lib LIBS += -lecl -leql5 -L.. -L/usr/local/lib
TARGET = eql5_webkit TARGET = eql5_webkit
DESTDIR = ../ DESTDIR = ../
OBJECTS_DIR = ./tmp/webkit/ OBJECTS_DIR = ./tmp/webkit/
MOC_DIR = ./tmp/webkit/ MOC_DIR = ./tmp/webkit/
VERSION = $$(EQL_VERSION)
macx:QT += network macx:QT += network
linux { linux {
@ -28,11 +28,19 @@ win32 {
sailfish { sailfish {
# on Sailfish run this prior to run qmake: # on Sailfish run this prior to run qmake:
# $ export SAILFISH=sailfish # $ export SAILFISH=sailfish
QT -= printsupport uitools QT -= printsupport uitools
CONFIG += shared_and_static build_all
DEFINES += OS_SAILFISH DEFINES += OS_SAILFISH
message("*** Building for SailfishOS ***") message("*** Building for SailfishOS ***")
} }
static {
DESTDIR = ./
OBJECTS_DIR = ./tmp/static/webkit/
MOC_DIR = ./tmp/static/webkit/
INSTALLS -= target
}
HEADERS += gen/webkit/_ini.h \ HEADERS += gen/webkit/_ini.h \
gen/webkit/_ini2.h \ gen/webkit/_ini2.h \
gen/webkit/_q_classes.h \ gen/webkit/_q_classes.h \