have_library fails on SunOS 5.8 sun4u ??

Discussion in 'Ruby' started by ahoward, Jun 26, 2003.

  1. ahoward

    ahoward Guest

    rubyists-

    i'm trying to compile the ruby-postgres package, and it seems that
    'have_library' is not working on SunOS 5.8 sun4u??

    for example:

    /tmp/vtrcs/ruby-postgres-0.7.1 > uname -srm
    SunOS 5.8 sun4u

    /tmp/vtrcs/ruby-postgres-0.7.1 > cat foo.c
    #include <sys/types.h>
    #include <sys/socket.h>
    int main(int argc, char **argv) { socket(0, 0, 0); return 0; }

    /tmp/vtrcs/ruby-postgres-0.7.1 > gcc foo.c -lsocket

    /tmp/vtrcs/ruby-postgres-0.7.1 > ruby extconf.rb --with-pgsql-dir=/usr/local/pgsql
    checking for cygwin32_socket() in -lwsock32... no
    checking for socket() in -lsocket... no
    checking for socket() in -lsys/socket... no
    checking for gethostbyname() in -linet... no
    checking for gethostbyname() in -lnsl... no
    checking for sys/un.h... yes
    checking for socket()... no
    checking for cygwin32_socket()... no


    unless i'm overlooking something totally obvious, it seems that if foo.c
    compiled using -lsocket, have_library 'socket', 'socket' should succeed and
    print 'yes'... in fact, it looks like *all* calls to have_library are
    failing, which seems unlikely... am i missing something here??

    perplexed.

    -a
    --
    ====================================
    | Ara Howard
    | NOAA Forecast Systems Laboratory
    | Information and Technology Services
    | Data Systems Group
    | R/FST 325 Broadway
    | Boulder, CO 80305-3328
    | Email:
    | Phone: 303-497-7238
    | Fax: 303-497-7259
    | ~ > ruby -e 'p(%.\x2d\x29..intern)'
    ====================================
     
    ahoward, Jun 26, 2003
    #1
    1. Advertisements

  2. ahoward

    ts Guest

    a> i'm trying to compile the ruby-postgres package, and it seems that
    a> 'have_library' is not working on SunOS 5.8 sun4u??

    The problem is not in have_library

    nasun% uname -srm
    SunOS 5.8 sun4u
    nasun%

    nasun% ruby extconf.rb --with-pgsql-dir=/usr/local/pgsql
    checking for cygwin32_socket() in -lwsock32... no
    checking for socket() in -lsocket... yes
    checking for gethostbyname() in -linet... no
    checking for gethostbyname() in -lnsl... yes
    checking for sys/un.h... yes
    checking for socket()... yes
    checking for hsterror()... no
    checking for gethostname()... yes
    checking for PQsetdbLogin() in -lpq... yes
    checking for PQsetClientEncoding()... yes
    checking for pg_encoding_to_char()... no
    checking for PQescapeString()... yes
    creating Makefile
    nasun%

    Look in the file mkmf.log to see the result of the command, and why it
    fail


    Guy Decoux
     
    ts, Jun 26, 2003
    #2
    1. Advertisements

  3. ahoward

    ahoward Guest

    thanks guy:

    gcc -o conftest -I/usr/local/lib/ruby/1.6/sparc-solaris2.8 -g -O2
    -I/usr/local/include -I/usr/local/pgsql /include -Wl,-E
    -L/usr/local/pgsql/lib conftest.c -lwsock32 -lc -ldl -lcrypt -lm
    /usr/ccs/bin/ld: illegal option -- E

    looks like rbconfig thinks the linker options need -E. anyone know a clean
    way around this?

    -a

    -a
    --
    ====================================
    | Ara Howard
    | NOAA Forecast Systems Laboratory
    | Information and Technology Services
    | Data Systems Group
    | R/FST 325 Broadway
    | Boulder, CO 80305-3328
    | Email:
    | Phone: 303-497-7238
    | Fax: 303-497-7259
    | ~ > ruby -e 'p(%.\x2d\x29..intern)'
    ====================================
     
    ahoward, Jun 26, 2003
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.