Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am looking for alternative of install_name_tool of MAC in CentOS. Exactly I want to build MySQL on non default location. Also the shared libraries of the mysql binary should be on non default location and properly linked.

I wasnt able to link shared libraries libssl & libcrypto to the mysqld binary.

[user@localhost mysql]$ ldd /usr/local/mysql/bin/mysqld
        linux-gate.so.1 =>  (0x00186000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x008e2000)
        libz.so.1 => /lib/libz.so.1 (0x0097f000)
        librt.so.1 => /lib/librt.so.1 (0x00912000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00c70000)
        libdl.so.2 => /lib/libdl.so.2 (0x00727000)
        libssl.so.1.0.0 => not found
        libcrypto.so.1.0.0 => not found
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00a7e000)
        libm.so.6 => /lib/libm.so.6 (0x008b0000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00a70000)
        libc.so.6 => /lib/libc.so.6 (0x00755000)
        /lib/ld-linux.so.2 (0x00731000)

I am sure that openssl is installed in /usr/local/extra directory as i also installed apache perfectly, which is currently working, my configure command is :

cmake . -LH -DCMAKE_INCLUDE_PATH=/usr/local/extra/include -DCMAKE_LIBRARY_PATH=/usr/local/extra/lib -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/var -DSYSCONFDIR=/usr/local/mysql/etc -DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock -DCURSES_LIBRARY=/usr/local/extra/lib/libncurses.so.5 -DCURSES_INCLUDE_PATH=/usr/local/extra/include -DWITH_SSL=yes -DWITH_ZLIB=system

While configuring it also shows :

-- checking for module 'openssl'
--   found openssl, version 0.9.8e-rhel5
-- Found OpenSSL: /usr/local/extra/lib/libssl.so;/usr/local/extra/lib/libcrypto.so (found version "1..")

Can any one suggest me a tool to link shared libraries to the binary.

share|improve this question

migrated from stackoverflow.com Nov 29 '11 at 14:59

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

The PatchELF utility might be useful. Otherwise, see the ldconfig man page, and the file: /etc/ld.so.conf

share|improve this answer
    
Hi. Thanks, adding path to ld.so.conf worked. But it was affecting my PC in some way which I couldn't recognize. Like my gedit stopped working after that, etc. Also this fix would work only for my PC. I want to use same binaries on other machine. There I wont be able to edit the ld.so.conf file. I will try PathELF now, but is there any other way to fix this ? Thanks a tonne. –  John D Nov 29 '11 at 13:55
    
PatchELF is exactly what i needed. Again thanks a tonne. –  John D Nov 29 '11 at 14:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.