Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes building on ARMv7 and a couple other things #96

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 17 additions & 0 deletions install_debian.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions pCloudCC/lib/mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions pCloudCC/lib/pclsync/pcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@

#define P_OS_ID 7

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

#else

Expand Down
10 changes: 5 additions & 5 deletions pCloudCC/lib/pclsync/pcompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@
#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
#define likely(expr) (expr)
#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)
Expand Down
2 changes: 1 addition & 1 deletion pCloudCC/lib/pclsync/psettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down