使用cygwin在Windows上构建Seafile-Client

时间:2018-10-10 18:38:34

标签: makefile cygwin seafile-server

我尝试使用cygwin在Windows上构建seafile-client。当我调用./configure命令时,它会将构建系统检测为Linux

...
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for WIN32... no
checking for Mac... no
checking for Linux... compile in linux
checking for uuid_generate in -luuid... yes
found library uuid
...

它配置成功,但是当我调用make命令时,会发生很多错误。我猜这是因为它可以将构建系统检测为linux,但是我认为它一定是Windows。我该如何解决呢?

输出错误:

Making all in daemon
make[2]: Entering directory '/cygdrive/c/msys/1.0/home/seafile-6.2.4/daemon'
gcc -DHAVE_CONFIG_H -I. -I..    -DPKGDATADIR=\"/usr/local/share/seafile\" -DPACKAGE_DATA_DIR=\""/usr/local/share/seafile"\" -DSEAFILE_CLIENT -I../include -I../lib -I../lib -I../common -D_REENTRANT -I/usr/local/include -I/usr/local/include/searpc -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -g -O2 -MT http-tx-mgr.o -MD -MP -MF .deps/http-tx-mgr.Tpo -c -o http-tx-mgr.o http-tx-mgr.c
http-tx-mgr.c: 'http_get' işlevinde:
http-tx-mgr.c:741:91: hata: expected ')' before 'USER_AGENT_OS'
     headers = curl_slist_append (headers, "User-Agent: Seafile/"SEAFILE_CLIENT_VERSION" ("USER_AGENT_OS")");
                                                                                           ^~~~~~~~~~~~~
http-tx-mgr.c: 'http_put' işlevinde:
http-tx-mgr.c:865:91: hata: expected ')' before 'USER_AGENT_OS'
     headers = curl_slist_append (headers, "User-Agent: Seafile/"SEAFILE_CLIENT_VERSION" ("USER_AGENT_OS")");
                                                                                           ^~~~~~~~~~~~~
http-tx-mgr.c: 'http_post' işlevinde:
http-tx-mgr.c:982:91: hata: expected ')' before 'USER_AGENT_OS'
     headers = curl_slist_append (headers, "User-Agent: Seafile/"SEAFILE_CLIENT_VERSION" ("USER_AGENT_OS")");
                                                                                           ^~~~~~~~~~~~~
Üst düzeyde:
http-tx-mgr.c:507:1: UYARI: 'load_ca_bundle' defined but not used [-Wunused-function]
 load_ca_bundle (CURL *curl)
 ^~~~~~~~~~~~~~
make[2]: *** [Makefile:581: http-tx-mgr.o] Error 1
make[2]: Leaving directory '/cygdrive/c/msys/1.0/home/seafile-6.2.4/daemon'
make[1]: *** [Makefile:444: all-recursive] Error 1
make[1]: Leaving directory '/cygdrive/c/msys/1.0/home/seafile-6.2.4'
make: *** [Makefile:376: all] Error 2

此代码是为交叉编译而编写的,包含许多如下定义:

...
#ifdef WIN32
#include <windows.h>
#include <wincrypt.h>
#endif
...
#ifndef SEAFILE_CLIENT_VERSION
#define SEAFILE_CLIENT_VERSION PACKAGE_VERSION
#endif

#ifdef WIN32
#define USER_AGENT_OS "Windows NT"
#endif

#ifdef __APPLE__
#define USER_AGENT_OS "Apple OS X"
#endif

#ifdef __linux__
#define USER_AGENT_OS "Linux"
#endif

#if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __DragonFly__
#define USER_AGENT_OS "BSD"
#endif
...

0 个答案:

没有答案