From 49df5abf7cc10b0fba1095ea4cea96d67aff8bfe Mon Sep 17 00:00:00 2001 From: Tom Cubie Date: Thu, 14 Jan 2016 12:18:32 +0800 Subject: [PATCH 1/2] Fix build for mac osx After run make: mkdir -p bin/ cc -o bin/pcs.o -c -fPIC -D_FILE_OFFSET_BITS=64 pcs/pcs.c pcs/pcs.c:10:11: fatal error: 'openssl/md5.h' file not found ... Try to install openssl: brew install openssl Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables: LDFLAGS: -L/usr/local/opt/openssl/lib CPPFLAGS: -I/usr/local/opt/openssl/include Also, compiler says "clang: warning: -largp: 'linker' input unused", so remove it. --- makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 7b44a32c..1dc66d3b 100644 --- a/makefile +++ b/makefile @@ -14,7 +14,7 @@ CYGWIN_CCFLAGS = endif ifeq ($(LC_OS_NAME), darwin) -APPLE_CCFLAGS = -largp +APPLE_CCFLAGS = -I/usr/local/opt/openssl/include else APPLE_CCFLAGS = endif @@ -26,7 +26,7 @@ else CCFLAGS:=-g -D_FILE_OFFSET_BITS=64 -DDEBUG -D_DEBUG endif -PCS_CCFLAGS = -fPIC $(CCFLAGS) +PCS_CCFLAGS = -fPIC $(CCFLAGS) $(CYGWIN_CCFLAGS) $(APPLE_CCFLAGS) all: bin/libpcs.a bin/pcs @@ -102,7 +102,7 @@ uninstall4-dev: .PHONY : clean clean : - -rm ./bin/*.o ./bin/*.so ./bin/libpcs.a ./bin/pcs + -rm -f ./bin/*.o ./bin/*.so ./bin/libpcs.a ./bin/pcs .PHONY : pre pre : From 2098971003a4b21a252f1b8b02dca42e70c2559e Mon Sep 17 00:00:00 2001 From: Tom Cubie Date: Thu, 14 Jan 2016 12:34:25 +0800 Subject: [PATCH 2/2] Add build instructions for Mac --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index c2ed8c2d..5ac819cc 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,20 @@ C/C++写的一个百度网盘工具,可以在linux终端中使用。 #### 下载 [适用Windows的预编译版本] 或 下载 .net4.0 带窗体版本 [BaiduCloudDisk for .Net 4.0] +编译 (Mac): +=================================== +### 1. 获取源代码 + git clone https://github.com/GangZhuo/BaiduPCS.git +### 2. 安装依赖 + brew install openssl +### 3. 编译源代码 + cd BaiduPCS + make clean + make + make install #将安装到/usr/local/bin下 +### 4. 手动安装到其他目录,例如 /usr/bin 下 + cp ./bin/pcs /usr/bin/ + 编译 (Openwrt): =================================== ### 进入 [Openwrt SDK] 目录,然后执行如下命令: