From 5dba4612b5f7b4659006f46b077c4ad514b5fc58 2018-12-01 11:38:15 From: Florian Kinder Date: 2018-12-01 11:38:15 Subject: [PATCH] Syntax fixes --- diff --git a/Dockerfile b/Dockerfile index 91a721dd2b7d559b16dfe58736af2a7e1a81beaf..3f9d08078cde5bbd12a75ec41e76c53272bbc2d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ VOLUME ["/etc/spectrum2/transports", "/var/lib/spectrum2"] ADD . /usr/src/spectrum2 RUN apk add --no-cache ca-certificates && \ - apk add --no-cache --virtual .build-deps cmake make gcc g++ musl-dev boost-dev glib-dev protobuf-dev mariadb-dev sqlite-dev postgresql-dev pidgin-dev libev-dev qt-dev apr-util-dev automake autoconf libtool git popt-dev curl-dev openssl && \ + apk add --no-cache --virtual .build-deps cmake make gcc g++ musl-dev boost-dev glib-dev protobuf-dev mariadb-dev sqlite-dev postgresql-dev pidgin-dev libev-dev qt-dev apr-util-dev automake autoconf libtool git popt-dev curl-dev openssl libevent-dev && \ cd /usr/src/ && \ wget https://github.com/communi/libcommuni/archive/v3.5.0.tar.gz -O libcommuni-3.5.0.tar.gz && \ @@ -29,7 +29,7 @@ RUN apk add --no-cache ca-certificates && \ tar xfz libpqxx-*.tar.gz && \ cd libpqxx-* && \ ./autogen.sh && \ - ./configure --disable-documentation && \ + ./configure --enable-shared --disable-documentation && \ make && \ make install && \ cd .. && rm -rf libpqxx-* && \ @@ -37,7 +37,11 @@ RUN apk add --no-cache ca-certificates && \ wget https://swift.im/downloads/releases/swift-4.0rc2/swift-4.0rc2.tar.gz && \ tar xfz swift-*.tar.gz && \ cd swift-* && \ - ./scons SWIFT_INSTALLDIR=/usr/local /usr/local && \ + ./scons Swiften SWIFTEN_INSTALLDIR=/usr/local /usr/local && \ cd .. && rm -rf swift-* && \ + cd spectrum2 && \ + cmake . && \ + make && \ + apk del .build-deps diff --git a/backends/libpurple/main.cpp b/backends/libpurple/main.cpp index 585be7cc697229299d3a4752727935c9614bc5b0..1658aecf9a13c7d98176f45b4f96c4740a18582e 100644 --- a/backends/libpurple/main.cpp +++ b/backends/libpurple/main.cpp @@ -482,7 +482,7 @@ class SpectrumNetworkPlugin : public NetworkPlugin { purple_accounts_delete_wrapped(account); #ifndef WIN32 -#if !defined(__FreeBSD__) && !defined(__APPLE__) +#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__) malloc_trim(0); #endif #endif @@ -2111,7 +2111,7 @@ static void signed_on(PurpleConnection *gc, gpointer unused) { PurpleAccount *account = purple_connection_get_account_wrapped(gc); np->handleConnected(np->m_accounts[account]); #ifndef WIN32 -#if !defined(__FreeBSD__) && !defined(__APPLE__) +#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__) // force returning of memory chunks allocated by libxml2 to kernel malloc_trim(0); #endif @@ -2335,7 +2335,7 @@ int main(int argc, char **argv) { boost::locale::generator gen; std::locale::global(gen("")); #ifndef WIN32 -#if !defined(__FreeBSD__) && !defined(__APPLE__) +#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__) mallopt(M_CHECK_ACTION, 2); mallopt(M_PERTURB, 0xb); #endif diff --git a/backends/swiften/main.cpp b/backends/swiften/main.cpp index f0acdb6dab291246e0a9469e6038ed16dfe6dd13..6c111464872c99efdf7f1a3b807cd00241d43d41 100644 --- a/backends/swiften/main.cpp +++ b/backends/swiften/main.cpp @@ -227,10 +227,12 @@ class SwiftenPlugin : public NetworkPlugin, Swift::XMPPParserClient { #ifndef WIN32 #ifndef __FreeBSD__ #ifndef __MACH__ +#if defined (__GLIBC__) // force returning of memory chunks allocated by libxml2 to kernel malloc_trim(0); #endif #endif +#endif #endif } diff --git a/spectrum/src/main.cpp b/spectrum/src/main.cpp index 1bd53ff31b4e8cd3370d3e95c648d4103ec2700d..655dd89c7d69999b14b8984160aafdbb1bc03c25 100644 --- a/spectrum/src/main.cpp +++ b/spectrum/src/main.cpp @@ -320,11 +320,13 @@ int main(int argc, char **argv) #ifndef WIN32 #ifndef __FreeBSD__ #ifndef __MACH__ +#if defined (__GLIBC__) mallopt(M_CHECK_ACTION, 2); mallopt(M_PERTURB, 0xb); #endif #endif #endif +#endif #ifndef WIN32 if (signal(SIGINT, spectrum_sigint_handler) == SIG_ERR) {