yzfedora / baidudl

This is a multi-thread download tool for pan.baidu.com
GNU General Public License v3.0
199 stars 35 forks source link

安装失败:make 过程报错 #5

Open liyang85 opened 8 years ago

liyang85 commented 8 years ago

备注

configure.ac:13: installing './compile'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
src/Makefile.am: installing './depcomp'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking dependency style of gcc... (cached) gcc3
checking for pthread_create in -lpthread... yes
checking for curl_easy_init in -lcurl... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking malloc.h usability... no
checking malloc.h presence... no
checking for malloc.h... no
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for off_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for ftruncate... yes
checking for memmove... yes
checking for memset... yes
checking for socket... yes
checking for strchr... yes
checking for strrchr... yes
checking for strstr... yes
checking for strtol... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands

执行make提示信息

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT bdpandl.o -MD -MP -MF .deps/bdpandl.Tpo -c -o bdpandl.o bdpandl.c
mv -f .deps/bdpandl.Tpo .deps/bdpandl.Po
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dlcommon.o -MD -MP -MF .deps/dlcommon.Tpo -c -o dlcommon.o dlcommon.c
mv -f .deps/dlcommon.Tpo .deps/dlcommon.Po
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dlinfo.o -MD -MP -MF .deps/dlinfo.Tpo -c -o dlinfo.o dlinfo.c
dlinfo.c:125:11: warning: implicit declaration of function 'strcasestr' is invalid in C99
      [-Wimplicit-function-declaration]
        if ((p = strcasestr(header_buf, HEADER_CONTENT_LENGTH))) {
                 ^
dlinfo.c:125:9: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int'
      [-Wint-conversion]
        if ((p = strcasestr(header_buf, HEADER_CONTENT_LENGTH))) {
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dlinfo.c:135:9: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int'
      [-Wint-conversion]
        if ((p = strcasestr(header_buf, HEADER_FILENAME))) {
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dlinfo.c:197:21: warning: implicit declaration of function 'open_memstream' is invalid in C99
      [-Wimplicit-function-declaration]
        if (!(header_ptr = open_memstream(&header_buf, &header_len))) {
                           ^
dlinfo.c:197:19: warning: incompatible integer to pointer conversion assigning to 'FILE *'
      (aka 'struct __sFILE *') from 'int' [-Wint-conversion]
        if (!(header_ptr = open_memstream(&header_buf, &header_len))) {
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dlinfo.c:246:19: warning: incompatible integer to pointer conversion assigning to 'FILE *'
      (aka 'struct __sFILE *') from 'int' [-Wint-conversion]
        if (!(header_ptr = open_memstream(&header_buf, &header_len))) {
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dlinfo.c:599:16: error: use of undeclared identifier 'SIGWINCH'
        if (sigaction(SIGWINCH, &act, &old) == -1)
                      ^
dlinfo.c:636:7: warning: passing 'ssize_t *' (aka 'long *') to parameter of type 'size_t *'
      (aka 'unsigned long *') converts between pointers to integer types with different sign
      [-Wpointer-sign]
                           &orig_start, &orig_end, &orig_no);
                           ^~~~~~~~~~~
dlinfo.c:91:19: note: passing argument to parameter 'start' here
                               size_t *start,
                                       ^
dlinfo.c:636:20: warning: passing 'ssize_t *' (aka 'long *') to parameter of type 'size_t *'
      (aka 'unsigned long *') converts between pointers to integer types with different sign
      [-Wpointer-sign]
                           &orig_start, &orig_end, &orig_no);
                                        ^~~~~~~~~
dlinfo.c:92:19: note: passing argument to parameter 'end' here
                               size_t *end,
                                       ^
dlinfo.c:645:6: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
                                        (long)(*dp)->dp_no,
                                        ^~~~~~~~~~~~~~~~~~
9 warnings and 1 error generated.
make[2]: *** [dlinfo.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
yzfedora commented 8 years ago

@yang-s-li 刚刚把open_memstream和strcasestr重新实现了, 你现在可以git clone or git pull更新下代码, 再 ./autogen.sh && make && sudo make install, 试试能不能正常编译使用, 如有问题再联系我

liyang85 commented 8 years ago
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT bdpandl.o -MD -MP -MF .deps/bdpandl.Tpo -c -o bdpandl.o bdpandl.c
mv -f .deps/bdpandl.Tpo .deps/bdpandl.Po
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dlcommon.o -MD -MP -MF .deps/dlcommon.Tpo -c -o dlcommon.o dlcommon.c
mv -f .deps/dlcommon.Tpo .deps/dlcommon.Po
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dlinfo.o -MD -MP -MF .deps/dlinfo.Tpo -c -o dlinfo.o dlinfo.c
dlinfo.c:601:16: error: use of undeclared identifier 'SIGWINCH'
        if (sigaction(SIGWINCH, &act, &old) == -1)
                      ^
1 error generated.
make[2]: *** [dlinfo.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
yzfedora commented 8 years ago

@yang-s-li 刚刚添加了#ifdef宏, 麻烦你再git pull然后编译试试, 因为我用的Linux也没法测试, 抱歉

liyang85 commented 8 years ago

非常感谢你的耐心调试,不过还是有问题:

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dlinfo.o -MD -MP -MF .deps/dlinfo.Tpo -c -o dlinfo.o dlinfo.c
dlinfo.c:605:16: error: use of undeclared identifier 'SIGWINCH'
        if (sigaction(SIGWINCH, &act, &old) == -1)
                      ^
1 error generated.
make[2]: *** [dlinfo.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
yzfedora commented 8 years ago

@yang-s-li 能麻烦你再试试吗?估计是刚刚的Mac OSX预定义宏的问题, 现在修改了下

yzfedora commented 8 years ago

@yang-s-li 这个问题的原因主要还是Mac OSX废弃了两个信号处理宏造成的, SIGWINCH 和 SIGINFO.

liyang85 commented 8 years ago

这次倒是没有报错,但我 不确定 是否安装成功,因为我 无法下载

1. make log

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dlinfo.o -MD -MP -MF .deps/dlinfo.Tpo -c -o dlinfo.o dlinfo.c
mv -f .deps/dlinfo.Tpo .deps/dlinfo.Po
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dlpart.o -MD -MP -MF .deps/dlpart.Tpo -c -o dlpart.o dlpart.c
mv -f .deps/dlpart.Tpo .deps/dlpart.Po
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dlscrolling.o -MD -MP -MF .deps/dlscrolling.Tpo -c -o dlscrolling.o dlscrolling.c
mv -f .deps/dlscrolling.Tpo .deps/dlscrolling.Po
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dllist.o -MD -MP -MF .deps/dllist.Tpo -c -o dllist.o dllist.c
mv -f .deps/dllist.Tpo .deps/dllist.Po
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT err_handler.o -MD -MP -MF .deps/err_handler.Tpo -c -o err_handler.o err_handler.c
mv -f .deps/err_handler.Tpo .deps/err_handler.Po
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dlbuffer.o -MD -MP -MF .deps/dlbuffer.Tpo -c -o dlbuffer.o dlbuffer.c
mv -f .deps/dlbuffer.Tpo .deps/dlbuffer.Po
gcc  -g -O2 -Wall -Wextra -lpthread  -o bdpandl bdpandl.o dlcommon.o dlinfo.o dlpart.o dlscrolling.o dllist.o err_handler.o dlbuffer.o  -lcurl -lpthread
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT bdpandl-decode.o -MD -MP -MF .deps/bdpandl-decode.Tpo -c -o bdpandl-decode.o bdpandl-decode.c
mv -f .deps/bdpandl-decode.Tpo .deps/bdpandl-decode.Po
gcc  -g -O2 -Wall  -o bdpandl-decode bdpandl-decode.o err_handler.o  -lcurl -lpthread

2. sudo make install log

Password:
Making install in src
 .././install-sh -c -d '/usr/local/bin'
  /usr/bin/install -c bdpandl bdpandl-decode '/usr/local/bin'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.

3. download log

3.1 download link type 1:

bdpandl -n 10 'https://1gaa1hcjsgazdnctafa3ucmmrgyzgramjct4zya5uf3ts65e.ourdvsss.com/d0.baidupcs.com/file/576f12006b388bdac88d79a6d4f03040\?bkt\=p3-00008ef918aa60e1f1639a13ce335f2ee6bc\&xcode\=273c142eb7bcd861d2ecb37d09227a00ce377be97ad7977bded0b7c77404c736\&fid\=1363427504-250528-221437667937263\&time\=1476881733\&sign\=FDTAXGERLBH-DCb740ccc5511e5e8fedcff06b081203-5dDOIlSGHefEfnhoQUygmSxF6Vc%3D\&to\=cb00\&fm\=Yan,B,T,t\&sta_dx\=387063296\&sta_cs\=1370\&sta_ft\=dmg\&sta_ct\=5\&sta_mt\=5\&fm2\=Yangquan,B,T,t\&newver\=1\&newfm\=1\&secfm\=1\&flow_ver\=3\&pkey\=00008ef918aa60e1f1639a13ce335f2ee6bc\&sl\=72613967\&expires\=8h\&rt\=sh\&r\=325756771\&mlogid\=6792526700614100692\&vuk\=2150372647\&vbdid\=3658023147\&fin\=VMware%20Fusion%208%20Pro%20for%20Mac%208.5.dmg\&fn\=VMware%20Fusion%208%20Pro%20for%20Mac%208.5.dmg\&slt\=pm\&uta\=0\&rtype\=0\&iv\=1\&isw\=0\&dp-logid\=6792526700614100692\&dp-callid\=0.1.1\&hps\=1\&csl\=395\&csign\=3hFoghOUHbaoMFZq%2Bsi2OFqhNGI%3D\&wshc_tag\=0\&wsts_tag\=58076d46\&wsid_tag\=b7279a9c\&wsiphost\=ipdbm'

3.2 download link type 2:

bdpandl -n 10 'https://rh120n.jomodns.com/r/d0.baidupcs.com/file/5a79936742ab28055a39bf03c20a38bd\?bkt\=p3-00004635c08eac2323deeba013a43b84707a\&xcode\=b4f5f0edab281d61c3a22410af109cf81f8a47eb6950fc2ea7103330c9091c9b\&fid\=1363427504-250528-330624063264982\&time\=1476882034\&sign\=FDTAXGERLBH-DCb740ccc5511e5e8fedcff06b081203-7cVUMvlCHfj0WGEMl4mu0epC1F4%3D\&to\=cb00\&fm\=Yan,B,T,t\&sta_dx\=21623808\&sta_cs\=437\&sta_ft\=dmg\&sta_ct\=2\&sta_mt\=2\&fm2\=Yangquan,B,T,t\&newver\=1\&newfm\=1\&secfm\=1\&flow_ver\=3\&pkey\=00004635c08eac2323deeba013a43b84707a\&sl\=72941647\&expires\=8h\&rt\=sh\&r\=594256457\&mlogid\=6792607493539723138\&vuk\=2150372647\&vbdid\=3658023147\&fin\=Sketch%20for%20Mac%2040.3.dmg\&fn\=Sketch%20for%20Mac%2040.3.dmg\&slt\=pm\&uta\=0\&rtype\=0\&iv\=1\&isw\=0\&dp-logid\=6792607493539723138\&dp-callid\=0.1.1\&hps\=1\&csl\=390\&csign\=OwIfasTjhlt1E3hnGTqWkoMdp9g%3D'

3.3 download link type 3:

bdpandl -n 10 'https://pan.baidu.com/share/link\?shareid\=109966568\&uk\=1363427504'

3.4 备注

yzfedora commented 8 years ago

@yang-s-li 你应该用type1 or type2的那种下载地址, 就是你点击baidu网页的下载按钮后会弹出下载框, 下载框中的地址才是真正的地址, https://pan.baidu.com/share/link\?shareid\=109966568\&uk\=1363427504只是一个网页地址.

如果你想要达到你带宽的最大速度, 可以增加线程数, 我一般是设置为200, bdpandl -n 200 'download url'.

一般的下载的地址形式: https://nj02all01.baidupcs.com/file/b4db45d9f40dcbf1ecec26cf7d9b68ef?bkt=p3-1400b4db45d9f40dcbf1ecec26cf7d9b68efd09b1fa7000000347e7f&fid=2299716616-250528-565350700585065&time=1476874588&sign=FDTAXGERLBH-DCb740ccc5511e5e8fedcff06b081203-RxuiueRrsOrB%2FP%2FGIgYfk4uI41w%3D&to=nj2hb&fm=Nan,B,U,ny&sta_dx=3440255&sta_cs=&sta_ft=rar&sta_ct=5&sta_mt=5&fm2=Nanjing02,B,U,ny&newver=1&newfm=1&secfm=1&flow_ver=3&pkey=1400b4db45d9f40dcbf1ecec26cf7d9b68efd09b1fa7000000347e7f&sl=73400399&expires=8h&rt=pr&r=222681139&mlogid=6790608637837400045&vuk=2299716616&vbdid=2381365252&fin=bjlsetup.rar&fn=bjlsetup.rar&slt=pm&uta=0&rtype=1&iv=0&isw=0&dp-logid=6790608637837400045&dp-callid=0.1.1&hps=1&csl=447&csign=CzY2eT%2F7Ca%2FEpPd0gHlGBsqsbVM%3D

批量下载的地址形式: https://www.baidupcs.com/rest/2.0/pcs/file?method=batchdownload&app_id=250528&zipcontent=%7B%22fs_id%22%3A%5B493440108743247%5D%7D&sign=DCb740ccc5511e5e8fedcff06b081203:AEfHnslayXFuRrAyJXmIhBBu6b8%3D&uid=2299716616&time=1476961466&dp-logid=6790736950781286365&dp-callid=0&vuk=2299716616&zipname=%E5%81%B6%E5%83%8F%E6%B4%BB%E5%8A%A8.zip

这种url有一个到期时间, 也就是说可能你过了8小时还没下完, 这个地址就会失效. 但是这种情况很少发生, 我带宽是50Mb, 下行大概最高7MB, 用打包下载下一个10GB的动漫也就最多半小时, 2GB的3分钟搞定.

还有, 如果你发现下载速度变慢了, 你可以Ctrl-C终止下载, 然后再重新下载. 就会达到最大速度.

yzfedora commented 8 years ago

@yang-s-li 顺便一提, 你的下载地址到期了...... 所以没法下载 0.0, 重新到下载页面点击下载按钮,然后复制下载链接.

bdpandl -n 200 ‘下载链接'

liyang85 commented 8 years ago

你提供的下载地址也到期了?我刚用你的地址试了一下,仍然是「failed to download from url」。

另外,我的系统是默认配置了 http、HTTPS 代理的,对 bdpandl 有无影响?

yzfedora commented 8 years ago

我刚刚用的下载地址还没到期, 可以下载的, 麻烦你加上-d 2选项, 或直接运行下面的命令, 然后把输出发给我.

bdpandl -d 2 'https://www.baidupcs.com/rest/2.0/pcs/file?method=batchdownload&app_id=250528&zipcontent=%7B%22fs_id%22%3A%5B493440108743247%5D%7D&sign=DCb740ccc5511e5e8fedcff06b081203:AEfHnslayXFuRrAyJXmIhBBu6b8%3D&uid=2299716616&time=1476961466&dp-logid=6790736950781286365&dp-callid=0&vuk=2299716616&zipname=%E5%81%B6%E5%83%8F%E6%B4%BB%E5%8A%A8.zip'

liyang85 commented 8 years ago
--------------Received Meta info---------------
HTTP/1.1 405 Not Allowed
Date: Wed, 19 Oct 2016 14:24:27 GMT
Content-Type: text/plain; charset=utf-8
Connection: close
x-bs-client-ip: MTgzLjM5LjE1NC4xNTY=
x-bs-request-id: MTAuMjE1LjI1Mi41ODo4NjQzOjY3OTA3MzY5NTA3ODEyODYzNjU6MjAxNi0xMC0xOSAyMjoyNDoyNw==
content-length: 24
Server: POMS/CloudUI 1.0

--------------Received Meta info---------------

--------------Received Meta info---------------
HTTP/1.1 200 OK
Date: Wed, 19 Oct 2016 14:24:29 GMT
Content-Type: application/zip
Connection: keep-alive
x-bs-client-ip: MTgzLjM5LjE1NC4xNTY=
x-bs-request-id: MTAuMjE1LjI1NC4xOTo4NjQzOjY3OTA3MzY5NTA3ODEyODYzNjU6MjAxNi0xMC0xOSAyMjoyNDoyOA==
expires: 0
content-disposition: attachment; filename="偶像活动.zip"
content-length: 8147836037
Server: POMS/CloudUI 1.0

filename=偶像活动.zip, length=8147836037

thread 0 starting to download range: 0-814783602

thread 1 starting to download range: 814783603-1629567205

thread 2 starting to download range: 1629567206-2444350808

thread 3 starting to download range: 2444350809-3259134411

thread 4 starting to download range: 3259134412-4073918014

thread 5 starting to download range: 4073918015-4888701617

thread 6 starting to download range: 4888701618-5703485220

thread 8 starting to download range: 6518268824-7333052426

thread 9 starting to download range: 7333052427-8147836036

thread 7 starting to download range: 5703485221-6518268823

偶像活动.zip                                              7.6GiB     0.0%  2.21MiB/s  01:00:02  [10]
[1]    16849 illegal hardware instruction  bdpandl -d 2
yzfedora commented 8 years ago

@yang-s-li 我想起来了, 哈哈, 之前也有一位编译后运行的时候遇到硬件指令异常,不过到现在也不知道为什么, 如果你有空的话, 能不能让我用teamviewer连接到你的Mac, 然后快速的用gdb调式下看看为什么会硬件异常? 如果可以的话, 麻烦把teamviewer id和password直接发我邮箱yzfedora@gmail.com, 谢谢

liyang85 commented 8 years ago

TeamViewer ID & Password 已发送,你看何时方便调试?我需要提前做什么准备吗?