diff --git a/.gitignore b/.gitignore index e0292b19..fcf9a284 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,11 @@ *.o *.a +*.so +pCloudCC/CMakeCache.txt +pCloudCC/CMakeFiles/ +pCloudCC/Makefile +pCloudCC/cmake_install.cmake +pCloudCC/install_manifest.txt +pCloudCC/lib/mbedtls/Makefile +pCloudCC/lib/mbedtls/library/Makefile +pCloudCC/pcloudcc diff --git a/README.md b/README.md index 7cae5772..5ad8198e 100644 --- a/README.md +++ b/README.md @@ -12,27 +12,27 @@ Also requires [CMake](https://cmake.org/) build system. On Ubuntu you can run the following command: -> sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev +> sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev libudev-dev ## Build steps -> sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev git +> sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev libudev-dev git > mkdir console-client > git clone https://github.com/pcloudcom/console-client.git ./console-client/ -> cd ./console-client/pCloudCC/ -> cd lib/pclsync/ -> make clean -> make fs -> cd ../mbedtls/ -> cmake . -> make clean -> make -> cd ../.. -> cmake . -> make -> sudo make install -> ldconfig -> pcloudcc -u username -p +> cd ./console-client/pCloudCC/ +> cd lib/pclsync/ +> make clean +> make fs +> cd ../mbedtls/ +> cmake . +> make clean +> make +> cd ../.. +> cmake . +> make +> sudo make install +> ldconfig +> pcloudcc -u username -p ## Usage Terminal command is pcloudcc and -h option prints short options description. diff --git a/install_debian.sh b/install_debian.sh new file mode 100755 index 00000000..5e94e261 --- /dev/null +++ b/install_debian.sh @@ -0,0 +1,17 @@ +#!/bin/sh +sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev libudev-dev git +mkdir console-client +git clone https://github.com/pcloudcom/console-client.git ./console-client/ +cd ./console-client/pCloudCC/ +cd lib/pclsync/ +make clean +make fs +cd ../mbedtls/ +cmake . +make clean +make +cd ../.. +cmake . +make +sudo make install +ldconfig diff --git a/pCloudCC/lib/mbedtls/CMakeLists.txt b/pCloudCC/lib/mbedtls/CMakeLists.txt index eafe3017..420dff41 100644 --- a/pCloudCC/lib/mbedtls/CMakeLists.txt +++ b/pCloudCC/lib/mbedtls/CMakeLists.txt @@ -4,7 +4,7 @@ project(MBEDTLS C) string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}") set (CMAKE_INSTALL_LOCAL_ONLY ON) if(CMAKE_COMPILER_IS_GNUCC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wlogical-op -fPIC") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wlogical-op -fPIC") set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_DEBUG "-O0 -g3") set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") @@ -15,7 +15,7 @@ if(CMAKE_COMPILER_IS_GNUCC) endif(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_CLANG) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith") set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_DEBUG "-O0 -g3") set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") diff --git a/pCloudCC/lib/pclsync/pcompat.h b/pCloudCC/lib/pclsync/pcompat.h index b5fd2198..802db391 100644 --- a/pCloudCC/lib/pclsync/pcompat.h +++ b/pCloudCC/lib/pclsync/pcompat.h @@ -92,7 +92,9 @@ #define P_OS_ID 7 +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #else diff --git a/pCloudCC/lib/pclsync/pcompiler.h b/pCloudCC/lib/pclsync/pcompiler.h index 61c68055..ffe55820 100644 --- a/pCloudCC/lib/pclsync/pcompiler.h +++ b/pCloudCC/lib/pclsync/pcompiler.h @@ -45,15 +45,15 @@ #endif #endif -#ifndef __has_builtin +#ifndef PSYNC_HAS_BUILTIN #if defined(__GNUC__) -#define __has_builtin(x) 1 +#define PSYNC_HAS_BUILTIN(x) 1 #else -#define __has_builtin(x) 0 +#define PSYNC_HAS_BUILTIN(x) 0 #endif #endif -#if __has_builtin(__builtin_expect) +#if PSYNC_HAS_BUILTIN(__builtin_expect) #define likely(expr) __builtin_expect(!!(expr), 1) #define unlikely(expr) __builtin_expect(!!(expr), 0) #else @@ -61,7 +61,7 @@ #define unlikely(expr) (expr) #endif -#if __has_builtin(__builtin_prefetch) +#if PSYNC_HAS_BUILTIN(__builtin_prefetch) #define psync_prefetch(expr) __builtin_prefetch(expr) #elif defined(_MSC_VER) #define psync_prefetch(expr) _mm_prefetch((char *)(expr), _MM_HINT_T0) diff --git a/pCloudCC/lib/pclsync/psettings.h b/pCloudCC/lib/pclsync/psettings.h index 71fb8f24..ff67970e 100644 --- a/pCloudCC/lib/pclsync/psettings.h +++ b/pCloudCC/lib/pclsync/psettings.h @@ -233,7 +233,7 @@ #define PSYNC_FS_MAX_READAHEAD (16*1024*1024) #define PSYNC_FS_MAX_READAHEAD_IF_SEC (64*1024*1024) #define PSYNC_FS_MAX_READAHEAD_SEC 16 -#define PSYNC_FS_DEFAULT_CACHE_SIZE ((uint64_t)5*1024*1024*1024) +#define PSYNC_FS_DEFAULT_CACHE_SIZE ((uint64_t)64*1024*1024) #define PSYNC_FS_DIRECT_UPLOAD_LIMIT (256*1024) #define PSYNC_FS_FILESIZE_FOR_2CONN (4*1024*1024) #define PSYNC_FS_FILE_LOC_HIST_SEC 30