【问题标题】:How to specify library path when making lftp from source从源代码制作lftp时如何指定库路径
【发布时间】:2019-09-07 11:11:54
【问题描述】:

我正在从源代码构建 lftp。如何正确配置它以支持 gnutls 库的安全协议?

我在 SuSE Linux 上,s390 unname -a Linux zdsdeveng03 3.0.101-108.84-default #1 SMP Fri Nov 30 15:57:27 UTC 2018 (7a72692) s390x s390x s390x GNU/Linux

系统上安装的常规lftp不支持TLS 1.2协议,但我需要使用它与z/OS ftp主机通信。

lftp -v LFTP |版本 4.6.3a |版权所有 (c) 1996-2014 Alexander V. Lukyanov ... 使用的库:Readline 5.2、GnuTLS 2.4.1、zlib 1.2.7

我正在尝试从源当前 lftp 版本编译并使用更新的 GnuTLS 库。

我编译了 gnutls-3.6.6 并将其安装在我的 ~/lib 文件夹中

现在正在尝试编译 lftp-4.8.4 我配置了它

./configure --with-gnutls=/gsa/pokgsa/home/l/e/leonidt/local --prefix=/gsa/pokgsa/home/l/e/leonidt/local --with-libpth-前缀=/gsa/pokgsa/home/l/e/leonidt/local/ LIBGNUTLS_LIBS=-L/gsa/pokgsa/home/l/e/leonidt/local/lib/ LIBGNUTLS_CFLAGS=-I/gsa/pokgsa/home/l /e/leonidt/local/include

/gsa/pokgsa/home/l/e/leonidt - 是我的主文件夹

然后安装它 进行安装

在运行 lftp 之前我已经设置了环境变量:

导出 LD_LIBRARY_PATH=/gsa/pokgsa/home/l/e/leonidt/local/lib:$LD_LIBRARY_PATH 导出 PATH=/gsa/pokgsa/home/l/e/leonidt/local/bin:$PATH

但我得到的 lftp 可执行文件不支持安全协议命令:

lftp
lftp :~> 设置 ftp:ssl-force true ftp:ssl-force: 没有这样的变量。 使用 `set -a' 查看所有变量。 lftp :~>

并且 lftp -v 输出不显示使用的库中的 GnuTLS。

所以我尝试运行 libtool 命令,生成并添加路径 /bin/sh ../libtool --silent --tag=CXX --mode=link g++ -O2 -Wall -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti -fno-implement-inlines -export -dynamic -s -o lftp lftp-lftp.o lftp-complete.o lftp-lftp_rl.o lftp-attach.o liblftp-jobs.la liblftp-tasks.la -L/usr/lib -L//gsa/pokgsa /home/l/e/leonidt/local/lib -lreadline -lutil -lncurses -ldl 手动将 -lgnutls 选项附加到末尾

它生成了可执行文件,现在在使用的库中显示 GnuTLS,但仍然不支持 set ftp:ssl-force true 命令,错误消息相同:(

链接时有一些消息: /bin/sh ../libtool --silent --tag=CXX --mode=link g++ -O2 -Wall -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti -fno-implement-inlines -export-dynamic -s -o lftp lftp-lftp.o lftp-complete.o lftp-lftp_rl.o lftp-attach.o liblftp-jobs .la liblftp-tasks.la -L/usr/lib -L//gsa/pokgsa/home/l/e/leonidt/local/lib -lreadline -lutil -lncurses -ldl -lgnutls

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/libutil.so搜索 -lutil 时

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/libutil.a搜索 -lutil 时

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/libdl.so搜索 -ldl 时

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/libdl.a搜索 -ldl 时

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/librt.so搜索时 -lrt

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/librt.a搜索时 -lrt

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/libm.so搜索时 -lm

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/libm.a搜索时 -lm

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/libc.so搜索 -lc 时

/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:跳过不兼容的/usr/lib/libc.a搜索 -lc 时

可能是不支持 set ftp:ssl-force true 命令的原因吗?

我用 file 命令检查了库:

文件 /usr/lib/libutil.so /usr/lib/libutil.so:指向`/lib/libutil.so.1'的符号链接

文件 /lib/libutil.so.1 /lib/libutil.so.1:指向`libutil-2.11.3.so'的符号链接

文件 /lib/libutil-2.11.3.so /lib/libutil-2.11.3.so:ELF 32-bit MSB 共享对象,IBM S/390,版本 1 (SYSV),用于 GNU/Linux 2.6.4,动态链接(使用共享libs),没有被剥离

库是 32 位的! 于是我找了64位的版本,在/lib64中找到了

所以我尝试运行上面的命令,明确指定 -L/lib64 而不是 -L/usr/lib

没有帮助 - 结果相同:(

谁能建议如何摆脱这种跳过不兼容的消息? 他们真的是问题的根源吗?

【问题讨论】:

  • 如果您需要程序的用户界面支持更多功能,那么您可能需要修改lftp,而不仅仅是使用更新的库版本重建它。不确定这里是否真的如此,但看起来确实如此。
  • 谢谢您,HM,但在这种情况下,我不需要任何新功能。仅仅获得现有的工作对我来说就足够了。其实我是今年年初搭建成功的,遇到了一个bug,从作者那里得到了补丁,现在需要重新构建,但是环境发生了一些变化,所以我无法重新构建它。我在 Linux 上的开发经验并不丰富,现在需要一些帮助。
  • 您是否真的在~/lib 中安装了较新的 gnutls,如问题中所述?不是~/local/lib,这似乎是您告诉configure 寻找它的地方?
  • “跳过不兼容的”库消息不太可能引起关注。在 multilib Linux 发行版中,32 位库安装在/usr/lib 中是典型的,64 位库安装在/usr/lib64 中。由于名称冲突,它们不能进入同一目录。但是软件包可能并不都遵循该约定,因此在 64 位构建期间会搜索这两个目录。如果构建成功完成,则找到这些库的可用版本,因此您无需对消息执行任何操作。
  • 常规构建确实从链接命令中省略了 libgnutls,这表明 configure 没有找到它或拒绝了它找到的版本,并选择在不支持它的情况下构建。阅读configure 的输出,看看它对那个库的描述。使用附加到链接行的-lgnutls 重新链接不太可能令人满意地解决此类问题。

标签: makefile libtool lftp gnutls s390x


【解决方案1】:

以下配方在运行 Amazon Linux 2 的后期 Amazon EC2 机器上制作最新版本的 LFTP,包括问题中请求的 gnutls-devel 库。

sudo -s yum -y remove lftp
wget http://lftp.yar.ru/ftp/lftp-4.9.2.tar.bz2
tar -xf lftp-4.9.2.tar.bz2
cd lftp-4.9.2
sudo -s yum -y groupinstall "Development Tools"
sudo -s yum -y install ncurses-devel
sudo -s yum -y install readline-devel
sudo -s yum -y install gnutls-devel
./configure
make
sudo -s make install
sudo -s ln -s /usr/local/bin/lftp /usr/bin/lftp
cd ..
lftp --version

lftp --version 命令的输出显示构建中使用了 gnutls 库。

FTP | Version 4.9.2 | Copyright (c) 1996-2020 Alexander V. Lukyanov

LFTP is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with LFTP.  If not, see <http://www.gnu.org/licenses/>.


Send bug reports and questions to the mailing list <lftp@uniyar.ac.ru>.

Libraries used: GnuTLS 3.3.29, Readline 6.2, zlib 1.2.7

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-05
    • 2012-12-15
    • 1970-01-01
    • 2020-07-18
    • 1970-01-01
    相关资源
    最近更新 更多