lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.08k stars 160 forks source link

Compiling with custom expat, zlib and readline libraries not working #229

Open areis422 opened 8 years ago

areis422 commented 8 years ago

Using the following compile statement

./configure --prefix=/usr --with-openssl=/usr --with-zlib=/opt/zlib-1.2.8 --with-readline=yes --with-readline-inc=/opt/readline-6.3/include --with-readline-lib=/opt/readline-6.3/lib --with-expat=yes --with-expat-inc=/opt/expat-2.1.0/include --with-expat-lib=/opt/expat-2.1.0/lib

LFTP is still looking to the system instead of to the targeted locations for the libraries. This is with LFTP 4.7.1

areis422 commented 8 years ago

After compile and install: lftp --version LFTP | Version 4.7.1 | Copyright (c) 1996-2016 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: Readline 5.1, Expat 1.95.8, OpenSSL 1.0.2g 1 Mar 2016, zlib 1.2.3

areis422 commented 8 years ago

Should be using: Read line 6.3 Expat 2.1.0 Zlib 1.2.8

lavv17 commented 8 years ago

What is the command line used to compile/link lftp? Send the log of configure and make.

chargr commented 8 years ago

I am also having an issue with openssl, where if I specify an alternate path (even --with-openssl=) the main lftp binary is linked to the standard location (I assume pkg-config). If I enable '--with-modules' the modules are looking for the right openssl - but ./bin/lftp still links to the old ssl libs.

Also building on a 64bit box (CentOS 5), /usr/lib was being used for zlib,expat,readline I worked around that with find . -name 'Makefile' -exec sed -i 's/\/usr\/lib$/\/usr\/lib64/' {} \;

I am setting LDFLAGS for RPATH - as this is how I did it for 4.6.5 (otherwise modules would not have rpath set)

LDFLAGS="-Wl,-rpath,/opt/utils/openssl-1.0.1/lib" \
./configure --prefix=/opt/utils/lftp-4.7.2 --with-openssl=/opt/utils/openssl-1.0.1 --with-modules
chargr commented 8 years ago

I have made some progress on this issue (I think)

READLINE_LDFLAGS was getting set with -L/usr/lib64 and being included before LDFLAGS (lftp_LDFLAGS in src/Makefile), so any attempt to override with LDFLAGS=-L/path/to/openssl failed - I suppose if I had specified a non-standard readline library it would have also tricked it into working. But in the end I ended up changing the configure script so readline_ld_flags does not get set (only really works for my case of non-standard openssl and standard readline)

OPENSSL_LDFLAGS does not get put anywhere in the lftp_LINK line

lftp_CPPFLAGS = $(AM_CPPFLAGS) $(READLINE_CFLAGS)
lftp_LDFLAGS = -export-dynamic $(READLINE_LDFLAGS)
lftp_LDADD = liblftp-jobs.la liblftp-tasks.la $(READLINE_LIBS)
...
lftp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
        $(CXXFLAGS) $(lftp_LDFLAGS) $(LDFLAGS) -o $@

This seems to also mean that if you use a nonstandard readline and nonstandard expat, your readline lib path with be set in READLINE_LDFLAGS and therefore lftp_LINK, but expat will not be, so the link will be to the wrong expat in the end, unless you specify manually in LDFLAGS or LIBS?

lavv17 commented 8 years ago

Please try 69e9c3b

augustas commented 5 years ago

I had to compile lftp 4.8.1 in an environment without root access and without ncurses/openssl/readline. I've compiled the necessary libraries and in order for lftp configure/make to work i had to provide the CXXFLAGSparam. Maybe this will help to solve the issue, here's my working configuration:

./configure --prefix=/home/USERNAME/build-tools/lftp --with-openssl=/home/USERNAME/libraries --with-readline=/home/USERNAME/libraries LD_LIBRARY_PATH=/home/USERNAME/libraries/lib CFLAGS="-I/home/USERNAME/libraries/include" LDFLAGS="-L/home/USERNAME/libraries/lib" CXXFLAGS="-I/home/USERNAME/libraries/include" 2>&1 | tee conf.log