[Libreoffice-commits] online.git: autogen.sh common/IoUtil.cpp common/Log.cpp common/SpookyV2.h configure.ac ios/README test/.gitignore test/Makefile.am test/run_unit.sh.in
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri May 24 07:50:35 UTC 2019
autogen.sh | 6 --
common/IoUtil.cpp | 1
common/Log.cpp | 4 -
common/SpookyV2.h | 6 +-
configure.ac | 1
ios/README | 22 +++-----
test/.gitignore | 6 +-
test/Makefile.am | 132 ++++++++++++++++++++++++++++++----------------------
test/run_unit.sh.in | 10 +--
9 files changed, 101 insertions(+), 87 deletions(-)
New commits:
commit bd00d9fd0576b8f249d2145d8570bc395d137dc1
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu May 23 14:58:34 2019 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Fri May 24 09:50:16 2019 +0200
Get rid of use of GNU libtool
It is is complicated enough to build the iOS app. Requiring GNU
libtool brings with it the risk of polluting the command environment
as there already is a completely different command in macOS with the
same name, /usr/bin/libtool. And as GNU libtool was used only to build
the unit tests for the "normal" server-based Online that are built and
run only on Linux anyway, we don't really need any of the
"portability" that GNU libtool brings.
Without GNU libtool, we compile all the $(wsd_sources) (see
test/Makefile.am) that the unit-* tests use into a single object file,
WsdSources.o. (Because they need to be compiled as PIC we can't use
the already compiled object files for the Online server programs.)
This required some additional minor changes to a few source files.
Change-Id: I20a2c523170376fa4c1a0d9d8d6b693a9779376f
Reviewed-on: https://gerrit.libreoffice.org/72840
Reviewed-by: Tor Lillqvist <tml at collabora.com>
Tested-by: Tor Lillqvist <tml at collabora.com>
diff --git a/autogen.sh b/autogen.sh
index f5043bec5..051cdb3f9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -16,11 +16,7 @@ EOF
exit 1
}
-if test `uname -s` = Linux; then
- libtoolize || failed "libtool"
-elif test `uname -s` = Darwin; then
- glibtoolize || failed "Can't find glibtoolize. For instance use the one from https://brew.sh, 'brew install libtool', or build GNU libtool yourself."
-fi
+mkdir -p m4
aclocal || failed "aclocal"
diff --git a/common/IoUtil.cpp b/common/IoUtil.cpp
index b1ee058a5..3cb73ede7 100644
--- a/common/IoUtil.cpp
+++ b/common/IoUtil.cpp
@@ -33,7 +33,6 @@
#include "Log.hpp"
#include "Util.hpp"
-using Poco::Net::Socket;
using Poco::Net::WebSocket;
namespace IoUtil
diff --git a/common/Log.cpp b/common/Log.cpp
index 5a0c2655d..697765db8 100644
--- a/common/Log.cpp
+++ b/common/Log.cpp
@@ -109,10 +109,10 @@ namespace Log
char* prefix(char* buffer, const std::size_t len, const char* level)
{
- const char *threadName = Util::getThreadName();
+ const char *threadName = ::Util::getThreadName();
Poco::DateTime time;
#ifdef __linux
- const long osTid = Util::getThreadId();
+ const long osTid = ::Util::getThreadId();
snprintf(buffer, len, "%s-%.05lu %.4u-%.2u-%.2u %.2u:%.2u:%.2u.%.6u [ %s ] %s ",
(Source.getInited() ? Source.getId().c_str() : "<shutdown>"),
osTid,
diff --git a/common/SpookyV2.h b/common/SpookyV2.h
index bfda65f93..c081e89f6 100644
--- a/common/SpookyV2.h
+++ b/common/SpookyV2.h
@@ -26,6 +26,9 @@
// slower than MD5.
//
+#ifndef INCLUDED_SPOOKYV2_H
+#define INCLUDED_SPOOKYV2_H
+
#include <stddef.h>
#ifdef _MSC_VER
@@ -295,5 +298,4 @@ private:
uint8 m_remainder; // length of unhashed data stashed in m_data
};
-
-
+#endif // INCLUDED_SPOOKYV2_H
diff --git a/configure.ac b/configure.ac
index 9fd6bfaee..3f68a75c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,6 @@
AC_PREREQ([2.63])
AC_INIT([loolwsd], [master], [libreoffice at lists.freedesktop.org])
-LT_INIT([shared, disable-static, dlopen])
AM_INIT_AUTOMAKE([1.10 subdir-objects tar-pax -Wno-portability])
diff --git a/ios/README b/ios/README
index be2f1062f..00f03dbd4 100644
--- a/ios/README
+++ b/ios/README
@@ -44,21 +44,17 @@ where misan.local is the macOS machine where I build the app, and
Then back to the Mac:
As you were able to build LibreOffice in step 1, you must already have
-GNU autoconf installed on the Mac. Install also GNU automake and
-libtool. Preferrably from sources, to make sure a potential
-installation of brew or similar will not pollute your environment with
-unknown stuff.
+GNU autoconf installed on the Mac. Install also GNU automake.
+Preferrably from sources, to make sure a potential installation of
+brew or similar will not pollute your environment with unknown stuff.
-As GNU libtool will be needed only for a very minimal part of the
-build (running the autogen.sh script, but not anything else), it's
-safest to install it somewhere that is not in your $PATH. Let's say
-/opt/libtool. (Installing Automake in the default /usr/local, which is
-in $PATH, is less risky.)
+Installing autoconf and automake in the default /usr/local, which is
+in $PATH, is not really risky. (Unlike some other GNUish tools, like
+libtool and pkg-config, which might mess up your LibreOffice build.)
-Run the autogen.sh script in the app folder, with GNU libtool
-available:
+Run the autogen.sh script in the app folder:
-PATH=/opt/libtool/bin:$PATH ./autogen.sh
+./autogen.sh
OR:
@@ -66,7 +62,7 @@ OR:
Then:
-brew install libtool npm
+brew install npm
./autogen.sh
sudo python -m ensurepip --default-pip
sudo pip install polib lxml
diff --git a/test/.gitignore b/test/.gitignore
index 3a7e5fe74..6f63beed2 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -4,9 +4,9 @@ Makefile
Makefile.in
*.log
*.trs
-.libs
-*.la
-*.lo
+*.so
*.o
+fakesockettest
test
run_unit.sh
+WsdSources.cpp
diff --git a/test/Makefile.am b/test/Makefile.am
index f1f43aee9..abd331a13 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -9,23 +9,22 @@ check_PROGRAMS = test fakesockettest
noinst_PROGRAMS = test fakesockettest unittest
-AM_CXXFLAGS = $(CPPUNIT_CFLAGS) -DTDOC=\"$(top_srcdir)/test/data\" \
+AM_CXXFLAGS = -fPIC -DPIC $(CPPUNIT_CFLAGS) -DTDOC=\"$(top_srcdir)/test/data\" \
-I${top_srcdir}/common -I${top_srcdir}/net -I${top_srcdir}/wsd -I${top_srcdir}/kit
-noinst_LTLIBRARIES = \
- unit-convert.la unit-typing.la \
- unit-timeout.la unit-prefork.la \
- unit-storage.la unit-client.la \
- unit-admin.la unit-tilecache.la \
- unit-fuzz.la unit-oob.la unit-http.la unit-oauth.la \
- unit-wopi.la unit-wopi-saveas.la \
- unit-wopi-ownertermination.la unit-wopi-versionrestore.la \
- unit-wopi-documentconflict.la unit_wopi_renamefile.la \
- unit-wopi-loadencoded.la
+noinst_PROGRAMS += \
+ unit-convert.so unit-typing.so \
+ unit-timeout.so unit-prefork.so \
+ unit-storage.so unit-client.so \
+ unit-admin.so unit-tilecache.so \
+ unit-fuzz.so unit-oob.so unit-http.so unit-oauth.so \
+ unit-wopi.so unit-wopi-saveas.so \
+ unit-wopi-ownertermination.so unit-wopi-versionrestore.so \
+ unit-wopi-documentconflict.so unit_wopi_renamefile.so \
+ unit-wopi-loadencoded.so
-MAGIC_TO_FORCE_SHLIB_CREATION = -rpath /dummy
-AM_LDFLAGS = -pthread -module $(MAGIC_TO_FORCE_SHLIB_CREATION) $(ZLIB_LIBS)
+AM_LDFLAGS = -pthread $(ZLIB_LIBS)
if ENABLE_SSL
AM_LDFLAGS += -lssl -lcrypto
@@ -60,11 +59,16 @@ if ENABLE_SSL
wsd_sources += ../net/Ssl.cpp
endif
+WsdSources.cpp :
+ for F in $(wsd_sources); do \
+ echo '#include "'$$F'"'; \
+ done >WsdSources.cpp
+
test_base_source = \
TileQueueTests.cpp \
WhiteBoxTests.cpp \
DeltaTests.cpp \
- $(wsd_sources)
+ WsdSources.cpp
test_all_source = \
$(test_base_source) \
@@ -86,36 +90,54 @@ fakesockettest_SOURCES = fakesockettest.cpp ../net/FakeSocket.cpp
fakesockettest_LDADD = $(CPPUNIT_LIBS)
# unit test modules:
-unit_oob_la_SOURCES = UnitOOB.cpp
-unit_http_la_SOURCES = UnitHTTP.cpp
-unit_fuzz_la_SOURCES = UnitFuzz.cpp
-unit_admin_la_SOURCES = UnitAdmin.cpp
-unit_admin_la_LIBADD = $(CPPUNIT_LIBS)
-unit_client_la_SOURCES = UnitClient.cpp ${test_all_source}
-unit_client_la_LIBADD = $(CPPUNIT_LIBS)
-unit_typing_la_SOURCES = UnitTyping.cpp
-unit_typing_la_LIBADD = $(CPPUNIT_LIBS)
-unit_convert_la_SOURCES = UnitConvert.cpp
-unit_timeout_la_SOURCES = UnitTimeout.cpp
-unit_prefork_la_SOURCES = UnitPrefork.cpp
-unit_storage_la_SOURCES = UnitStorage.cpp
-unit_tilecache_la_SOURCES = UnitTileCache.cpp
-unit_oauth_la_SOURCES = UnitOAuth.cpp
-unit_oauth_la_LIBADD = $(CPPUNIT_LIBS)
-unit_wopi_la_SOURCES = UnitWOPI.cpp
-unit_wopi_la_LIBADD = $(CPPUNIT_LIBS)
-unit_wopi_saveas_la_SOURCES = UnitWOPISaveAs.cpp
-unit_wopi_saveas_la_LIBADD = $(CPPUNIT_LIBS)
-unit_wopi_ownertermination_la_SOURCES = UnitWopiOwnertermination.cpp
-unit_wopi_ownertermination_la_LIBADD = $(CPPUNIT_LIBS)
-unit_wopi_versionrestore_la_SOURCES = UnitWOPIVersionRestore.cpp
-unit_wopi_versionrestore_la_LIBADD = $(CPPUNIT_LIBS)
-unit_wopi_documentconflict_la_SOURCES = UnitWOPIDocumentConflict.cpp
-unit_wopi_documentconflict_la_LIBADD = $(CPPUNIT_LIBS)
-unit_wopi_renamefile_la_SOURCES = UnitWOPIRenameFile.cpp
-unit_wopi_renamefile_la_LIBADD = $(CPPUNIT_LIBS)
-unit_wopi_loadencoded_la_SOURCES = UnitWOPILoadEncoded.cpp
-unit_wopi_loadencoded_la_LIBADD = $(CPPUNIT_LIBS)
+unit_oob_so_SOURCES = UnitOOB.cpp
+unit_oob_so_LDFLAGS = -shared
+unit_http_so_SOURCES = UnitHTTP.cpp
+unit_http_so_LDFLAGS = -shared
+unit_fuzz_so_SOURCES = UnitFuzz.cpp
+unit_fuzz_so_LDFLAGS = -shared
+unit_admin_so_SOURCES = UnitAdmin.cpp
+unit_admin_so_LDFLAGS = -shared
+unit_admin_so_LDADD = $(CPPUNIT_LIBS)
+unit_client_so_SOURCES = UnitClient.cpp ${test_all_source}
+unit_client_so_LDFLAGS = -shared
+unit_client_so_LDADD = $(CPPUNIT_LIBS)
+unit_typing_so_SOURCES = UnitTyping.cpp
+unit_typing_so_LDFLAGS = -shared
+unit_typing_so_LDADD = $(CPPUNIT_LIBS)
+unit_convert_so_SOURCES = UnitConvert.cpp
+unit_convert_so_LDFLAGS = -shared
+unit_timeout_so_SOURCES = UnitTimeout.cpp
+unit_timeout_so_LDFLAGS = -shared
+unit_prefork_so_SOURCES = UnitPrefork.cpp
+unit_prefork_so_LDFLAGS = -shared
+unit_storage_so_SOURCES = UnitStorage.cpp
+unit_storage_so_LDFLAGS = -shared
+unit_tilecache_so_SOURCES = UnitTileCache.cpp
+unit_tilecache_so_LDFLAGS = -shared
+unit_oauth_so_SOURCES = UnitOAuth.cpp
+unit_oauth_so_LDFLAGS = -shared $(CPPUNIT_LIBS)
+unit_wopi_so_SOURCES = UnitWOPI.cpp
+unit_wopi_so_LDFLAGS = -shared
+unit_wopi_so_LDADD = $(CPPUNIT_LIBS)
+unit_wopi_saveas_so_SOURCES = UnitWOPISaveAs.cpp
+unit_wopi_saveas_so_LDFLAGS = -shared
+unit_wopi_saveas_so_LDADD = $(CPPUNIT_LIBS)
+unit_wopi_ownertermination_so_SOURCES = UnitWopiOwnertermination.cpp
+unit_wopi_ownertermination_so_LDFLAGS = -shared
+unit_wopi_ownertermination_so_LDADD = $(CPPUNIT_LIBS)
+unit_wopi_versionrestore_so_SOURCES = UnitWOPIVersionRestore.cpp
+unit_wopi_versionrestore_so_LDFLAGS = -shared
+unit_wopi_versionrestore_so_LDADD = $(CPPUNIT_LIBS)
+unit_wopi_documentconflict_so_SOURCES = UnitWOPIDocumentConflict.cpp
+unit_wopi_documentconflict_so_LDFLAGS = -shared
+unit_wopi_documentconflict_so_LDADD = $(CPPUNIT_LIBS)
+unit_wopi_renamefile_so_SOURCES = UnitWOPIRenameFile.cpp
+unit_wopi_renamefile_so_LDFLAGS = -shared
+unit_wopi_renamefile_so_LDADD = $(CPPUNIT_LIBS)
+unit_wopi_loadencoded_so_SOURCES = UnitWOPILoadEncoded.cpp
+unit_wopi_loadencoded_so_LDFLAGS = -shared
+unit_wopi_loadencoded_so_LDADD = $(CPPUNIT_LIBS)
if HAVE_LO_PATH
SYSTEM_STAMP = @SYSTEMPLATE_PATH@/system_stamp
@@ -131,21 +153,21 @@ check-local:
# FIXME 2: unit-oob.la fails with symbol undefined:
# UnitWSD::testHandleRequest(UnitWSD::TestRequest, UnitHTTPServerRequest&, UnitHTTPServerResponse&) ,
-TESTS = unit-typing.la unit-convert.la unit-prefork.la unit-tilecache.la \
- unit-timeout.la unit-oauth.la unit-wopi.la unit-wopi-saveas.la \
- unit-wopi-ownertermination.la unit-wopi-versionrestore.la \
- unit-wopi-documentconflict.la unit_wopi_renamefile.la \
- unit-http.la \
- unit-wopi-loadencoded.la
-# TESTS = unit-client.la
-# TESTS += unit-admin.la
-# TESTS += unit-storage.la
+TESTS = unit-typing.so unit-convert.so unit-prefork.so unit-tilecache.so \
+ unit-timeout.so unit-oauth.so unit-wopi.so unit-wopi-saveas.so \
+ unit-wopi-ownertermination.so unit-wopi-versionrestore.so \
+ unit-wopi-documentconflict.so unit_wopi_renamefile.so \
+ unit-http.so \
+ unit-wopi-loadencoded.so
+# TESTS = unit-client.so
+# TESTS += unit-admin.so
+# TESTS += unit-storage.so
else
TESTS = ${top_builddir}/test/test
endif
-TEST_EXTENSIONS = .la
-LA_LOG_DRIVER = ${top_srcdir}/test/run_unit.sh
+TEST_EXTENSIONS = .so
+SO_LOG_DRIVER = ${top_srcdir}/test/run_unit.sh
EXTRA_DIST = data/delta-text.png data/delta-text2.png data/hello.odt data/hello.txt $(test_SOURCES) $(unittest_SOURCES) run_unit.sh
diff --git a/test/run_unit.sh.in b/test/run_unit.sh.in
index 1b4312824..c95cf4d55 100755
--- a/test/run_unit.sh.in
+++ b/test/run_unit.sh.in
@@ -21,7 +21,7 @@ verbose=''
print_help ()
{
- echo "Usage: run_unit.sh --test-name <name.la> [OPTIONS]"
+ echo "Usage: run_unit.sh --test-name <name.so> [OPTIONS]"
echo "Runs a specified unit test"
echo ""
echo " --log-file <file> Log output to this file - default /dev/stderr"
@@ -51,8 +51,8 @@ echo
echo "Running ${tst}"
echo " $cmd_line"
-# drop .la suffix
-tst=`echo $tst | sed s/\.la//`;
+# drop .so suffix
+tst=`echo $tst | sed s/\.so//`;
if test "z$tst" != "z" && test "z$CPPUNIT_TEST_NAME" != "z"; then
# $tst is not empty, but $CPPUNIT_TEST_NAME is set, exit early if they
@@ -134,7 +134,7 @@ else # newer unit tests.
--o:ssl.cert_file_path="${abs_top_builddir}/etc/cert.pem" \
--o:ssl.ca_file_path="${abs_top_builddir}/etc/ca-chain.cert.pem" \
--o:admin_console.username=admin --o:admin_console.password=admin \
- --unitlib="${abs_top_builddir}/test/.libs/$tst.so" 2> "$tst_log"; then
+ --unitlib="${abs_top_builddir}/test/$tst.so" 2> "$tst_log"; then
echo "Test $tst passed."
echo ":test-result: PASS $tst" >> $test_output
else
@@ -150,7 +150,7 @@ else # newer unit tests.
echo " --o:ssl.cert_file_path=\"${abs_top_builddir}/etc/cert.pem\" \\"
echo " --o:ssl.ca_file_path=\"${abs_top_builddir}/etc/ca-chain.cert.pem\" \\"
echo " --o:admin_console.username=admin --o:admin_console.password=admin \\"
- echo " --unitlib=\"${abs_top_builddir}/test/.libs/$tst.so\""
+ echo " --unitlib=\"${abs_top_builddir}/test/$tst.so\""
echo ""
echo " $ less $tst_log # for detailed failure log files"
echo "============================================================="
More information about the Libreoffice-commits
mailing list