代码之家  ›  专栏  ›  技术社区  ›  Zekeriya Akgül

使用cygwin在windows上构建Seafile客户端

  •  0
  • Zekeriya Akgül  · 技术社区  · 6 年前

    我尝试使用cygwin在windows上构建seafile客户端。当我调用./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
    ...
    

    生成错误输出:

    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 回复  |  直到 6 年前