INTERACT FORUM

More => Old Versions => JRiver Media Center 20 for Linux => Topic started by: RemyJ on October 16, 2013, 03:01:14 pm

Title: Here's how to build libcurl3 if you need it
Post by: RemyJ on October 16, 2013, 03:01:14 pm
If you need libcurl3 for non-Debian distros, here's how to build it easily.

You'll need the following packages (the exact names will change per distro).  
gcc
binutils
make
glibc-devel
libssh2-devel
openssl-devel (may be called libopenssl-devel)
zlib-devel

If you're on a 64bit distro, you'll need the 32bit versions of the last 4 packages.  They may be suffixed with .i686 or -32bit.

Download and extract the latest libcurl from http://curl.haxx.se/download/curl-7.33.0.tar.gz
Download the attached script into the curl-7.33.0 directory.
Now...
Code: [Select]
cd curl-7.33.0
chmod a+x libcurl-configure
./libcurl-configure.txt

# Assuming no errors
make

# Assuming no errors
readelf -V lib/.libs/libcurl.so.4.3.0
# in the version definition section you should see entries for CURL_OPENSSL_4 and CURL_OPENSSL_3
Version definition section '.gnu.version_d' contains 4 entries:
  Addr: 0x0000000000003a9c  Offset: 0x003a9c  Link: 4 (.dynstr)
  000000: Rev: 1  Flags: BASE   Index: 1  Cnt: 1  Name: libcurl.so.4
  0x001c: Rev: 1  Flags: none  Index: 2  Cnt: 1  Name: HIDDEN
  0x0038: Rev: 1  Flags: none  Index: 3  Cnt: 1  Name: CURL_OPENSSL_4
  0x0054: Rev: 1  Flags: none  Index: 4  Cnt: 1  Name: CURL_OPENSSL_3

# Assuming MC is installed in "/usr/lib/jriver/Media Center 19"
# you need to copy the shared lib and its links to the MC install directory
cp -d lib/.libs/libcurl.so* "/usr/lib/jriver/Media Center 19"

# Now start Media Center with the LD_LIBRARY_PATH set to the MC install dir.
LD_LIBRARY_PATH="/usr/lib/jriver/Media Center 19" mediacenter

Title: Re: Here's how to build libcurl3 if you need it
Post by: Mike Noe on October 16, 2013, 03:25:33 pm
thx.  Just curious, on openSuSe, /usr/lib/libcurl.so.4.3.0 has no entries for OPENSSL in the version header, but all still works with MC.  Is it because of the relocation table:

readelf -V /usr/lib/libcurl.so.4.3.0 | grep SSL:
Code: [Select]
0006b018  00000407 R_386_JUMP_SLOT   00000000   SSL_connect
0006b024  00000707 R_386_JUMP_SLOT   00000000   SSL_CTX_set_srp_passwo
0006b0a4  00002507 R_386_JUMP_SLOT   00000000   SSL_get1_session
0006b0b0  00002807 R_386_JUMP_SLOT   00000000   SSL_set_session
0006b0cc  00003007 R_386_JUMP_SLOT   00000000   UI_OpenSSL
0006b0d4  00003207 R_386_JUMP_SLOT   00000000   OPENSSL_add_all_algori
0006b0dc  00003407 R_386_JUMP_SLOT   00000000   SSL_CTX_set_verify
0006b0e4  00003607 R_386_JUMP_SLOT   00000000   SSL_SESSION_free
0006b120  00004607 R_386_JUMP_SLOT   00000000   SSL_ctrl
0006b12c  00004907 R_386_JUMP_SLOT   00000000   SSL_load_error_strings
0006b134  00004b07 R_386_JUMP_SLOT   00000000   SSL_peek
0006b170  00005a07 R_386_JUMP_SLOT   00000000   SSLv2_client_method
0006b184  00005f07 R_386_JUMP_SLOT   00000000   SSL_CTX_check_private_
0006b18c  00006207 R_386_JUMP_SLOT   00000000   SSL_CTX_use_certificat
0006b1a4  00006807 R_386_JUMP_SLOT   00000000   SSL_get_peer_certifica
0006b1c0  00006f07 R_386_JUMP_SLOT   00000000   SSL_free
0006b214  00008507 R_386_JUMP_SLOT   00000000   SSL_CTX_add_client_CA
0006b218  00008607 R_386_JUMP_SLOT   00000000   SSL_get_certificate
0006b224  00008a07 R_386_JUMP_SLOT   00000000   SSL_CTX_set_default_pa
0006b22c  00008c07 R_386_JUMP_SLOT   00000000   SSLv3_client_method
0006b26c  00009b07 R_386_JUMP_SLOT   00000000   SSL_set_connect_state
0006b278  00009e07 R_386_JUMP_SLOT   00000000   SSL_CTX_new
0006b280  00009f07 R_386_JUMP_SLOT   00000000   SSL_get_verify_result
0006b2a0  0000a607 R_386_JUMP_SLOT   00000000   SSL_read
0006b2a8  0000a807 R_386_JUMP_SLOT   00000000   SSL_set_fd
0006b2b0  0000aa07 R_386_JUMP_SLOT   00000000   SSL_CTX_use_PrivateKey
0006b2bc  0000ac07 R_386_JUMP_SLOT   00000000   SSL_pending
0006b2d0  0000b107 R_386_JUMP_SLOT   00000000   SSL_get_current_cipher
0006b328  0000c407 R_386_JUMP_SLOT   00000000   SSL_CTX_load_verify_lo
0006b338  0000c807 R_386_JUMP_SLOT   00000000   SSL_CIPHER_get_name
0006b35c  0000d007 R_386_JUMP_SLOT   00000000   SSLv23_client_method
0006b388  0000db07 R_386_JUMP_SLOT   00000000   SSL_get_privatekey
0006b3ac  0000e307 R_386_JUMP_SLOT   00000000   SSL_CTX_use_PrivateKey
0006b3b0  0000e407 R_386_JUMP_SLOT   00000000   SSL_library_init
0006b3b8  0000e607 R_386_JUMP_SLOT   00000000   SSL_CTX_set_default_pa
0006b3c4  0000e907 R_386_JUMP_SLOT   00000000   SSL_CTX_use_certificat
0006b3e8  0000f307 R_386_JUMP_SLOT   00000000   SSL_CTX_set_cipher_lis
0006b3f4  0000f507 R_386_JUMP_SLOT   00000000   SSL_new
0006b400  0000f807 R_386_JUMP_SLOT   00000000   SSL_CTX_use_certificat
0006b408  0000fa07 R_386_JUMP_SLOT   00000000   SSL_write
0006b418  0000ff07 R_386_JUMP_SLOT   00000000   SSL_CTX_get_cert_store
0006b46c  00011307 R_386_JUMP_SLOT   00000000   SSL_CTX_callback_ctrl
0006b4b0  00012407 R_386_JUMP_SLOT   00000000   SSL_shutdown
0006b4b4  00012507 R_386_JUMP_SLOT   00000000   SSL_CTX_set_srp_userna
0006b4cc  00012b07 R_386_JUMP_SLOT   00000000   SSL_get_shutdown
0006b534  00014307 R_386_JUMP_SLOT   00000000   SSL_CTX_ctrl
0006b568  00014f07 R_386_JUMP_SLOT   00000000   SSL_get_error
0006b578  00015207 R_386_JUMP_SLOT   00000000   SSL_CTX_free
0006b58c  00015607 R_386_JUMP_SLOT   00000000   SSLeay
0006b598  00015907 R_386_JUMP_SLOT   00000000   SSL_get_peer_cert_chai

It also shows:
 0x00000001 (NEEDED)                     Shared library: [libssl.so.1.0.0]
Title: Re: Here's how to build libcurl3 if you need it
Post by: RemyJ on October 16, 2013, 03:42:04 pm
Actually I was going to ask bob about that.  The mediacenter executable doesn't load libcurl directly, libJRreader.so does.  If you do an ldd libJRreader.so I think you'll see that there a complaint about libcurl not having version information.  What I'd like to know from bob is how we can tell whether libcurl is actually working or not.  Maybe try doing a check for updates or something.

Title: Re: Here's how to build libcurl3 if you need it
Post by: Mike Noe on October 16, 2013, 04:03:54 pm
yeah, good point, I think it's probably not working based on this:

ldd libJRReader.so
Code: [Select]
./libJRReader.so: /usr/lib/libcurl.so.4: no version information available (required by ./libJRReader.so)
        linux-gate.so.1 (0xf772c000)
        libcurl.so.4 => /usr/lib/libcurl.so.4 (0xf703a000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xf6eff000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xf6ee2000)
.
.
.

Unless I'm misunderstanding and it's now looking for "4"?
Title: Re: Here's how to build libcurl3 if you need it
Post by: RemyJ on October 16, 2013, 04:17:53 pm
libcurl numbering is a little strange.  The .so file numbering isn't necessarily the same as the CURL_ version and neither are the same as the original source packaging.  There are packages like libcurl3-7.32.0 that have files like libcurl.so.4 in them. :)
Title: Re: Here's how to build libcurl3 if you need it
Post by: Mike Noe on October 16, 2013, 04:29:25 pm
of course.  ;)

I just built per your instructions, had to install gcc48-32bit support, which apparently got the rest.  Anyway, no OPENSSL in the version section:

mike@linux-30ty:~/Packages/curl-7.33.0> readelf -V lib/.libs/libcurl.so.4.3.0
Code: [Select]
Version needs section '.gnu.version_r' contains 1 entries:
 Addr: 0x0000000000004ea0  Offset: 0x004ea0  Link: 5 (.dynstr)
  000000: Version: 1  File: libc.so.6  Cnt: 6
  0x0010:   Name: GLIBC_2.3  Flags: none  Version: 7
  0x0020:   Name: GLIBC_2.7  Flags: none  Version: 6
  0x0030:   Name: GLIBC_2.14  Flags: none  Version: 5
  0x0040:   Name: GLIBC_2.17  Flags: none  Version: 4
  0x0050:   Name: GLIBC_2.3.4  Flags: none  Version: 3
  0x0060:   Name: GLIBC_2.2.5  Flags: none  Version: 2

Title: Re: Here's how to build libcurl3 if you need it
Post by: RemyJ on October 16, 2013, 04:43:52 pm
I think you're missing the openssl 32 bit libraries.  

Try
yast -i libopenssl-devel-32bit

Oops, you may also need zlib-devel-32bit.
Title: Re: Here's how to build libcurl3 if you need it
Post by: RemyJ on October 16, 2013, 04:46:04 pm
...and do...
make clean
./libcurl-configure.txt
make
Title: Re: Here's how to build libcurl3 if you need it
Post by: Mike Noe on October 16, 2013, 05:07:43 pm
I think you're thinking of "zypper" instead of yast..  ;)

libopenssl-32bit was there.  I added zlib....

now I get this at then end of the "configure":
checking run-time libs availability... failed
configure: error: one or more libs available at link-time are not available run-time. Libs used at link-time: -lssh2  -lssl -lcrypto -lssl -lcrypto  -lz

But this shouldn't affect the build, right?
Title: Re: Here's how to build libcurl3 if you need it
Post by: RemyJ on October 16, 2013, 05:24:56 pm
Oh yeah... zypper. 

Anyway something's still not right.

Here's what I installed in my freshly installed 64 bit OpenSUSE vm...

gcc-32bit
glibc-devel-32bit
libssh2-devel
libssh2-1-32bit
libopenssl-devel-32bit
zlib-devel-32bit

They in turn installed a whole bunch of stuff.

One final gotcha was having to create a link in /usr/lib
ln -rs /usr/lib/libssh2.so.1.0.1 /usr/lib/libssh2.so





Title: Re: Here's how to build libcurl3 if you need it
Post by: Mike Noe on October 16, 2013, 06:06:33 pm
Okay, probably an issue here on my end, then.  Did you do an RC1 ISO or Factory?  I have a Factory+ (:)) install testing latest mesa and whatnot.  I'll try an RC1 install into a VM just to build the libcurl....

Edit:

Sweet mama, she lives....:
readelf -V lib/.libs/libcurl.so.4.3.0
Code: [Select]
Version definition section '.gnu.version_d' contains 4 entries:
  Addr: 0x0000000000003f88  Offset: 0x003f88  Link: 5 (.dynstr)
  000000: Rev: 1  Flags: BASE   Index: 1  Cnt: 1  Name: libcurl.so.4
  0x001c: Rev: 1  Flags: none  Index: 2  Cnt: 1  Name: HIDDEN
  0x0038: Rev: 1  Flags: none  Index: 3  Cnt: 1  Name: CURL_OPENSSL_4
  0x0054: Rev: 1  Flags: none  Index: 4  Cnt: 1  Name: CURL_OPENSSL_3

Just added your link from prev post...
Title: Re: Here's how to build libcurl3 if you need it
Post by: RemyJ on October 16, 2013, 06:12:48 pm
I just downloaded the standard 12.3 64 bit install iso.
Title: Re: Here's how to build libcurl3 if you need it
Post by: bob on October 17, 2013, 11:01:32 am
Actually I was going to ask bob about that.  The mediacenter executable doesn't load libcurl directly, libJRreader.so does.  If you do an ldd libJRreader.so I think you'll see that there a complaint about libcurl not having version information.  What I'd like to know from bob is how we can tell whether libcurl is actually working or not.  Maybe try doing a check for updates or something.
Libcurl is used for all of the media network file serving.
Title: Re: Here's how to build libcurl3 if you need it
Post by: RemyJ on October 17, 2013, 03:06:01 pm
Libcurl is used for all of the media network file serving.

Gotcha.  It looks like it's working with the stock libcurl even though ldd complains about not finding version information.