curl / Mailing Lists / curl-library / Single Mail

curl-library

"configure --with-zlib=<path>" does not work correctly

From: Alexander.Elgert via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 16 Nov 2018 03:06:09 +0000

Hello,

I compiled zlib version 1.2.11 and told configure where to look for this library, unfortunately it was not successful on redhat 7.6 because the construct "gcc -L<zlib1.2.11_path> -lz" adds the -L behind the "ldconfig -v" paths. So -L is useless, if there is a system wide zlib.

I configured curl this way:
./configure --prefix="$prefix" --with-ssl="$prefix" --enable-static --disable-shared --disable-manual --disable-lber --disable-ldap --disable-nls --without-libidn --enable-ipv6 --with-zlib="$prefix"

And there is the zlib 1.2.11:
2 1 aelgert_at_h75:~/src/curl-7.61.1>ll "$prefix/lib/libz.a" "$prefix/include/zlib.h"
-rw-r--r--. 1 aelgert aelgert 96239 Nov 16 01:00 /home/aelgert/src/curl/include/zlib.h
-rw-r--r--. 1 aelgert aelgert 147226 Nov 16 01:00 /home/aelgert/src/curl/lib/libz.a

And the version is correct:
0 1 aelgert_at_h75:~/src/curl-7.61.1>head -2 /home/aelgert/src/curl/include/zlib.h
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.11, January 15th, 2017
0 1 aelgert_at_h75:~/src/curl-7.61.1>

But the system one is taken

0 1 aelgert_at_h75:~/src/curl-7.61.1/src>./curl --version
curl 7.61.1 (x86_64-pc-linux-gnu) libcurl/7.61.1 OpenSSL/1.1.1 zlib/1.2.7
...
0 1 aelgert_at_h75:~/src/curl-7.61.1/src>ldd curl
...
        libz.so.1 => /lib64/libz.so.1 (0x00007f5f26bc7000)
...

0 1 aelgert_at_h75:~/src/curl-7.61.1/src>ldconfig -v | grep libz
        libz.so.1 -> libz.so.1.2.7

By replacing -lz with "$prefix/lib/libz.a", it selects the correct library:

0 1 aelgert_at_h75:~/src/curl-7.61.1/src>gcc -Werror-implicit-function-declaration -O2 -Wno-system-headers -pthread -o curl curl-slist_wc.o curl-tool_binmode.o curl-tool_bname.o curl-tool_cb_dbg.o curl-tool_cb_hdr.o curl-tool_cb_prg.o curl-tool_cb_rea.o curl-tool_cb_see.o curl-tool_cb_wrt.o curl-tool_cfgable.o curl-tool_convert.o curl-tool_dirhie.o curl-tool_doswin.o curl-tool_easysrc.o curl-tool_filetime.o curl-tool_formparse.o curl-tool_getparam.o curl-tool_getpass.o curl-tool_help.o curl-tool_helpers.o curl-tool_homedir.o curl-tool_hugehelp.o curl-tool_libinfo.o curl-tool_main.o curl-tool_metalink.o curl-tool_msgs.o curl-tool_operate.o curl-tool_operhlp.o curl-tool_panykey.o curl-tool_paramhlp.o curl-tool_parsecfg.o curl-tool_strdup.o curl-tool_setopt.o curl-tool_sleep.o curl-tool_urlglob.o curl-tool_util.o curl-tool_vms.o curl-tool_writeout.o curl-tool_xattr.o ../lib/curl-strtoofft.o ../lib/curl-nonblock.o ../lib/curl-warnless.o ../lib/curl-curl_ctype.o -L/home/aelgert/src/curl/lib ../lib/.libs/libcurl.a -l
ssl "/home/aelgert/src/curl/lib/libz.a" -lcrypto -ldl -pthread

0 1 aelgert_at_h75:~/src/curl-7.61.1/src>./curl --version
curl 7.61.1 (x86_64-pc-linux-gnu) libcurl/7.61.1 OpenSSL/1.1.1 zlib/1.2.11

Regards,
Alexander

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-11-16