Errors compiling Ruby under Solaris

I’m trying to compile Ruby under Solaris. I suck at C, so I don’t know
what the heck I’m doing. Here’s what happened:

gcc -fPIC -Dsocklen_t=int -I. -g -O2 -I. -I/stage/public/solaris/ruby
-I/stage/public/solaris/ruby -I/stage/public/solaris/ruby/ext/socket
-DHAVE_NETINET_TCP_H -DHAVE_NETINET_UDP_H -DHAVE_SENDMSG
-DHAVE_INET_NTOP -DHAVE_INET_PTON -DHAVE_GETSERVBYPORT
-DHAVE_ARPA_INET_H -DHAVE_ARPA_NAMESER_H -DHAVE_RESOLV_H -DHAVE_SYS_UN_H
-DHAVE_SYS_UIO_H -DHAVE_SOCKET -DHAVE_GETHOSTNAME
-Dss_family=__ss_family -Dss_len=__ss_len -c socket.c
In file included from /usr/include/netinet/in.h:41,
from /usr/include/sys/socket.h:203,
from socket.c:31:
/usr/include/sys/stream.h:307: parse error before "projid_t"
socket.c:96:1: warning: “_SS_MAXSIZE” redefined
/usr/include/sys/socket.h:216:1: warning: this is the location of the
previous definition
socket.c:97:1: warning: “_SS_ALIGNSIZE” redefined
/usr/include/sys/socket.h:233:1: warning: this is the location of the
previous definition
socket.c:98:1: warning: “_SS_PAD1SIZE” redefined
/usr/include/sys/socket.h:238:1: warning: this is the location of the
previous definition
socket.c:99:1: warning: “_SS_PAD2SIZE” redefined
/usr/include/sys/socket.h:239:1: warning: this is the location of the
previous definition
socket.c:102: redefinition of struct sockaddr_storage' *** Error code 1 make: Fatal error: Command failed for targetsocket.o’
Current working directory /stage/public/solaris/ruby/ext/socket
*** Error code 1
make: Fatal error: Command failed for target `all’

Can anyone make heads or tails of that? I looked in the file it said it
had a parse error in, but things looked okay…

-Kurt

Hi,

In file included from /usr/include/netinet/in.h:41,
from /usr/include/sys/socket.h:203,
from socket.c:31:
/usr/include/sys/stream.h:307: parse error before “projid_t”

I have no clue about Solaris system headers, what are there
around that line?

socket.c:96:1: warning: “_SS_MAXSIZE” redefined
/usr/include/sys/socket.h:216:1: warning: this is the location of the
previous definition
(snip)
socket.c:102: redefinition of `struct sockaddr_storage’

Seems that extconf.rb failed to detect struct sockaddr_storage.
Could you show mkmf.log?

···

At Wed, 27 Aug 2003 10:35:57 +0900, Kurt M. Dresner wrote:


Nobu Nakada

Hi,

···

At Wed, 27 Aug 2003 11:43:46 +0900, nobu.nokada@softhome.net wrote:

In file included from /usr/include/netinet/in.h:41,
from /usr/include/sys/socket.h:203,
from socket.c:31:
/usr/include/sys/stream.h:307: parse error before “projid_t”

I have no clue about Solaris system headers, what are there
around that line?

As for this, I heard that gcc 3.0 has problems but 3.0.3 works
fine. What’s the version? Try `gcc -dumpversion’.


Nobu Nakada

I am using 3.0.3.

I tried to send the log (config.log) but it was too big, so the list
manager refused the email.

-Kurt

···

On Wed, Aug 27, 2003 at 12:02:20PM +0900, nobu.nokada@softhome.net wrote:

Hi,

At Wed, 27 Aug 2003 11:43:46 +0900, > nobu.nokada@softhome.net wrote:

In file included from /usr/include/netinet/in.h:41,
from /usr/include/sys/socket.h:203,
from socket.c:31:
/usr/include/sys/stream.h:307: parse error before “projid_t”

I have no clue about Solaris system headers, what are there
around that line?

As for this, I heard that gcc 3.0 has problems but 3.0.3 works
fine. What’s the version? Try `gcc -dumpversion’.


Nobu Nakada

======= End of Original Message =======<

Kurt M. Dresner wrote:

I am using 3.0.3.

I tried to send the log (config.log) but it was too big, so the list
manager refused the email.

Maybe you can put it on the web somewhere and post a
link to it?

Does codedbliss.com accept stuff that big?

Hal

Hi,

I am using 3.0.3.

Hmmm, more recent one doesn’t work?

I tried to send the log (config.log) but it was too big, so the list
manager refused the email.

Instead, send ext/socket/mkmf.log.

And which do you use, 1.8.0 or CVS HEAD?

···

At Wed, 27 Aug 2003 14:50:28 +0900, Kurt M. Dresner wrote:


Nobu Nakada

Instead, send ext/socket/mkmf.log.

And which do you use, 1.8.0 or CVS HEAD?

1.8.0

mkmf.log attached.

mkmf.log (14.3 KB)

···


Nobu Nakada

======= End of Original Message =======<

Hi,

···

At Wed, 27 Aug 2003 21:55:33 +0900, Kurt M. Dresner wrote:

In file included from /usr/include/netinet/in.h:41,
from /usr/include/sys/socket.h:203,
from conftest.c:2:
/usr/include/sys/stream.h:307: parse error before “projid_t”

What headers do you need to compile sys/socket.h?

#include <sys/socket.h>
int main() {return 0;}


Nobu Nakada

What headers do you need to compile sys/socket.h?

#include <sys/socket.h>
int main() {return 0;}

Should I write this C program and try to compile it?

-Kurt

Hi,

What headers do you need to compile sys/socket.h?

#include <sys/socket.h>
int main() {return 0;}

Should I write this C program and try to compile it?

Yes, but you can’t compile it. We need to know how we can
compile this simple code with gcc 3.0 on Solaris 8.

And as I mentioned;

···

At Sun, 31 Aug 2003 14:01:31 +0900, Kurt M. Dresner wrote:
At Wed, 27 Aug 2003 11:43:46 +0900, nobu.nokada@softhome.net wrote:

In file included from /usr/include/netinet/in.h:41,
from /usr/include/sys/socket.h:203,
from socket.c:31:
/usr/include/sys/stream.h:307: parse error before “projid_t”

I have no clue about Solaris system headers, what are there
around that line?

What is before the line?


Nobu Nakada

It turns out that the thing I sent before was from a Solaris 9 machine,
but apparently I need to compile it on a Solaris 8 machine. When I went
to the Solaris 8 machine and looked in that header file, there wasn’t
even a projid_t in the file, which makes me think it was different
headers. However, I still get this error message when I try to compile
under Solaris 8:

gcc -fPIC -Dsocklen_t=int -I. -g -O2 -I. -I/stage/public/solaris/ruby
-I/stage/public/solaris/ruby -I/stage/public/solaris/ruby/ext/socket
-DHAVE_NETINET_TCP_H -DHAVE_NETINET_UDP_H -DHAVE_SENDMSG
-DHAVE_INET_NTOP -DHAVE_INET_PTON -DHAVE_GETSERVBYPORT
-DHAVE_ARPA_INET_H -DHAVE_ARPA_NAMESER_H -DHAVE_RESOLV_H -DHAVE_SYS_UN_H
-DHAVE_SYS_UIO_H -DHAVE_SOCKET -DHAVE_GETHOSTNAME
-Dss_family=__ss_family -Dss_len=__ss_len -c socket.c
socket.c:96:1: warning: “_SS_MAXSIZE” redefined
/usr/include/sys/socket.h:213:1: warning: this is the location of the
previous definition
socket.c:97:1: warning: “_SS_ALIGNSIZE” redefined
/usr/include/sys/socket.h:230:1: warning: this is the location of the
previous definition
socket.c:98:1: warning: “_SS_PAD1SIZE” redefined
/usr/include/sys/socket.h:235:1: warning: this is the location of the
previous definition
socket.c:99:1: warning: “_SS_PAD2SIZE” redefined
/usr/include/sys/socket.h:236:1: warning: this is the location of the
previous definition
socket.c:102: redefinition of struct sockaddr_storage' *** Error code 1 make: Fatal error: Command failed for target socket.o’
Current working directory /stage/public/solaris/ruby/ext/socket
*** Error code 1
make: Fatal error: Command failed for target `all’
(01:16AM) [kdresner@sanjacinto /public/solaris/ruby]$

So how do I go about figuring out what headers I need for sys/socket.h?

Here are the #include’s from the file…

#include <sys/types.h>
#include <sys/uio.h>
#include <sys/feature_tests.h>

-Kurt

···

On Sun, Aug 31, 2003 at 02:23:52PM +0900, nobu.nokada@softhome.net wrote:

Hi,

At Sun, 31 Aug 2003 14:01:31 +0900, > Kurt M. Dresner wrote:

What headers do you need to compile sys/socket.h?

#include <sys/socket.h>
int main() {return 0;}

Should I write this C program and try to compile it?

Yes, but you can’t compile it. We need to know how we can
compile this simple code with gcc 3.0 on Solaris 8.

And as I mentioned;
At Wed, 27 Aug 2003 11:43:46 +0900, > nobu.nokada@softhome.net wrote:

In file included from /usr/include/netinet/in.h:41,
from /usr/include/sys/socket.h:203,
from socket.c:31:
/usr/include/sys/stream.h:307: parse error before “projid_t”

I have no clue about Solaris system headers, what are there
around that line?

What is before the line?


Nobu Nakada

======= End of Original Message =======<

FYI I’ve compiled ruby-1.8.0 on several Solaris 8 machines, without
problems. This was using gcc 2.95.3 on most and gcc 3.2.3 on one, with gcc
installed from sunfreeware packages.

I’ve just re-tested them:

irb(main):001:0> require ‘socket’
=> true

(although we use DRb and HTTP modules all the time, so I’m sure socket must
be OK :slight_smile:

So I wonder if it’s possible that you have bad header files on your machine

  • for example a mixture of gcc and non-gcc compilers?

Regards,

Brian.

···

On Sun, Aug 31, 2003 at 03:18:06PM +0900, Kurt M. Dresner wrote:

It turns out that the thing I sent before was from a Solaris 9 machine,
but apparently I need to compile it on a Solaris 8 machine. When I went
to the Solaris 8 machine and looked in that header file, there wasn’t
even a projid_t in the file, which makes me think it was different
headers. However, I still get this error message when I try to compile
under Solaris 8:

Hi,

It turns out that the thing I sent before was from a Solaris 9 machine,
but apparently I need to compile it on a Solaris 8 machine. When I went
to the Solaris 8 machine and looked in that header file, there wasn’t
even a projid_t in the file, which makes me think it was different
headers.

Try -E option to check the pre-processed source.

So how do I go about figuring out what headers I need for sys/socket.h?

Here are the #include’s from the file…

What file?

#include <sys/types.h>
#include <sys/uio.h>
#include <sys/feature_tests.h>

Since -DHAVE_SYS_UIO_H is already defined, sys/feature_tests.h
is also necessary?

Although I guess it’s a bug of Solaris.

Index: ext/socket/extconf.rb

···

At Sun, 31 Aug 2003 15:18:06 +0900, Kurt M. Dresner wrote:

RCS file: /cvs/ruby/src/ruby/ext/socket/extconf.rb,v
retrieving revision 1.30
diff -u -2 -p -r1.30 extconf.rb
— ext/socket/extconf.rb 30 Jul 2003 00:32:03 -0000 1.30
+++ ext/socket/extconf.rb 31 Aug 2003 14:50:37 -0000
@@ -28,5 +28,5 @@ $ipv6 = false
default_ipv6 = /cygwin/ !~ RUBY_PLATFORM
if enable_config(“ipv6”, default_ipv6)

  • if try_link(<<EOF)
  • if checking_for(“ipv6”) {try_link(<<EOF)}
    #include <sys/types.h>
    #include <sys/socket.h>
    @@ -46,12 +46,9 @@ $ipv6libdir = nil
    $ipv6trylibc = nil
    if $ipv6
  • if macro_defined?(“IPV6_INRIA_VERSION”, <<EOF)
    -#include <netinet/in.h>
    -EOF
  • checking_for(“ipv6 type”) {
  • if macro_defined?(“IPV6_INRIA_VERSION”, “#include <netinet/in.h>”)
    $ipv6type = “inria”
    $CFLAGS="-DINET6 "+$CFLAGS
  • elsif macro_defined?(“KAME”, <<EOF)
    -#include <netinet/in.h>
    -EOF
  • elsif macro_defined?(“KAME”, “#include <netinet/in.h>”)
    $ipv6type = “kame”
    $ipv6lib=“inet6”
    @@ -64,21 +61,15 @@ EOF
    $ipv6libdir=“/usr/inet6/lib”
    $CFLAGS="-DINET6 -I/usr/inet6/include "+$CFLAGS
  • elsif macro_defined?(“_TOSHIBA_INET6”, <<EOF)
    -#include <sys/param.h>
    -EOF
  • elsif macro_defined?(“_TOSHIBA_INET6”, “#include <sys/param.h>”)
    $ipv6type = “toshiba”
    $ipv6lib=“inet6”
    $ipv6libdir=“/usr/local/v6/lib”
    $CFLAGS="-DINET6 "+$CFLAGS
  • elsif macro_defined?(“V6D”, <<EOF)
    -#include </usr/local/v6/include/sys/v6config.h>
    -EOF
  • elsif macro_defined?(“V6D”, “#include </usr/local/v6/include/sys/v6config.h>”)
    $ipv6type = “v6d”
    $ipv6lib=“v6”
    $ipv6libdir=“/usr/local/v6/lib”
    $CFLAGS="-DINET6 -I/usr/local/v6/include "+$CFLAGS
  • elsif macro_defined?(“_ZETA_MINAMI_INET6”, <<EOF)
    -#include <sys/param.h>
    -EOF
  • elsif macro_defined?(“_ZETA_MINAMI_INET6”, “#include <sys/param.h>”)
    $ipv6type = “zeta”
    $ipv6lib=“inet6”
    @@ -90,5 +81,6 @@ EOF
    $CFLAGS="-DINET6 "+$CFLAGS
    end
  • $ipv6type}
  • if $ipv6lib
    if File.directory? $ipv6libdir and File.exist? “#{$ipv6libdir}/lib#{$ipv6lib}.a”
    @@ -106,88 +98,32 @@ EOS
    end
  • if try_link(<<EOF)
    -#ifdef _WIN32
    -# include <windows.h>
    -# include <winsock.h>
    -#else
    -# include <sys/types.h>
    -# include <netdb.h>
    -# include <string.h>
    -# include <sys/socket.h>
    -# include <netinet/in.h>
    -#endif
    -int
    -main()
    -{
  • struct sockaddr_in sin;
  • sin.sin_len;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-DHAVE_SIN_LEN "+$CFLAGS
    +unless $mswin or $bccwin or $mingw
  • headers = %w<sys/types.h netdb.h string.h sys/socket.h netinet/in.h>
    +end
    +if /solaris/ =~ RUBY_PLATFORM and !try_compile(“”)
  • bug of gcc 3.0 on Solaris 8

  • headers << “sys/feature_tests.h”
    end
  • if try_link(<<EOF)
    -#ifdef _WIN32
    -# include <windows.h>
    -# include <winsock.h>
    -#else
    -# include <sys/types.h>
    -# include <netdb.h>
    -# include <string.h>
    -# include <sys/socket.h>
    -#endif
    -int
    -main()
    -{
  • struct sockaddr_storage ss;
  • ss.ss_family;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-DHAVE_SOCKADDR_STORAGE “+$CFLAGS
    -else # doug’s fix, NOW add -Dss_family… only if required!
    -$CPPFLAGS += " -Dss_family=__ss_family -Dss_len=__ss_len”
  • if try_link(<<EOF)
    -#ifdef _WIN32
    -# include <windows.h>
    -# include <winsock.h>
    -#else
    -# include <sys/types.h>
    -# include <netdb.h>
    -# include <string.h>
    -# include <sys/socket.h>
    -#endif
    -int
    -main()
    -{
  • struct sockaddr_storage ss;
  • ss.ss_family;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-DHAVE_SOCKADDR_STORAGE "+$CFLAGS
    +if have_struct_member(“struct sockaddr_in”, “sin_len”, headers)
  • $defs[-1] = “-DHAVE_SIN_LEN”
    end

+flags = " -Dss_family=__ss_family -Dss_len=__ss_len"
+begin

  • if have_struct_member(“struct sockaddr_storage”, “ss_family”, headers)
  • $defs[-1] = “-DHAVE_SOCKADDR_STORAGE”
  • elsif flags # doug’s fix, NOW add -Dss_family… only if required!
  • $CPPFLAGS += flags
  • retry
  • end
    end
  • if try_link(<<EOF)
    -#include <sys/types.h>
    -#include <netdb.h>
    -#include <string.h>
    -#include <sys/socket.h>
    -#include <netinet/in.h>
    -int
    -main()
    -{
  • struct sockaddr sa;
    +if have_struct_member(“struct sockaddr”, “sa_len”, headers)
  • $defs[-1] = "-DHAVE_SA_LEN "+$CFLAGS
    +end
  • sa.sa_len;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-DHAVE_SA_LEN "+$CFLAGS
    +unless have_type(“socklen_t”, headers)
  • $defs[-1] = “-Dsocklen_t=int”
    end

@@ -201,10 +137,6 @@ end

$getaddr_info_ok = false
-if !enable_config(“wide-getaddrinfo”, false) and try_run(<<EOF)
-#include <sys/types.h>
-#include <netdb.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
+if !enable_config(“wide-getaddrinfo”, false) and checking_for(“getaddrinfo”) {try_run(<<EOF)}
+#{cpp_include(headers)}

#ifndef AF_LOCAL
@@ -336,20 +268,4 @@ else
have_header(“arpa/nameser.h”)
have_header(“resolv.h”)
-end

-if !try_link(<<EOF)
-#include <sys/types.h>
-#include <netdb.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-int
-main()
-{

  • socklen_t len;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-Dsocklen_t=int "+$CFLAGS
    end


Nobu Nakada

gcc -fPIC -Dsocklen_t=int -I. -g -O2 -I. -I/stage/public/solaris/ruby
-I/stage/public/solaris/ruby -I/stage/public/solaris/ruby/ext/socket
-DHAVE_NETINET_TCP_H -DHAVE_NETINET_UDP_H -DHAVE_SENDMSG
-DHAVE_INET_NTOP -DHAVE_INET_PTON -DHAVE_GETSERVBYPORT
-DHAVE_ARPA_INET_H -DHAVE_ARPA_NAMESER_H -DHAVE_RESOLV_H -DHAVE_SYS_UN_H
-DHAVE_SYS_UIO_H -DHAVE_SOCKET -DHAVE_GETHOSTNAME
-Dss_family=__ss_family -Dss_len=__ss_len -c socket.c

What is strange is that you don't have the flag -DHAVE_SOCKADDR_STORAGE
this explain the error messages.

Have you build ruby from a fresh source (i.e. the direct result of `tar
zxf') ?

Guy Decoux

Try -E option to check the pre-processed source.

Is this -E on make?

So how do I go about figuring out what headers I need for sys/socket.h?

Here are the #include’s from the file…

What file?

/usr/include/sys/socket.h

#include <sys/types.h>
#include <sys/uio.h>
#include <sys/feature_tests.h>

Since -DHAVE_SYS_UIO_H is already defined, sys/feature_tests.h
is also necessary?

I dunno…

-Kurt

···

Although I guess it’s a bug of Solaris.

Index: ext/socket/extconf.rb

RCS file: /cvs/ruby/src/ruby/ext/socket/extconf.rb,v
retrieving revision 1.30
diff -u -2 -p -r1.30 extconf.rb
— ext/socket/extconf.rb 30 Jul 2003 00:32:03 -0000 1.30
+++ ext/socket/extconf.rb 31 Aug 2003 14:50:37 -0000
@@ -28,5 +28,5 @@ $ipv6 = false
default_ipv6 = /cygwin/ !~ RUBY_PLATFORM
if enable_config(“ipv6”, default_ipv6)

  • if try_link(<<EOF)
  • if checking_for(“ipv6”) {try_link(<<EOF)}
    #include <sys/types.h>
    #include <sys/socket.h>
    @@ -46,12 +46,9 @@ $ipv6libdir = nil
    $ipv6trylibc = nil
    if $ipv6
  • if macro_defined?(“IPV6_INRIA_VERSION”, <<EOF)
    -#include <netinet/in.h>
    -EOF
  • checking_for(“ipv6 type”) {
  • if macro_defined?(“IPV6_INRIA_VERSION”, “#include <netinet/in.h>”)
    $ipv6type = “inria”
    $CFLAGS="-DINET6 "+$CFLAGS
  • elsif macro_defined?(“KAME”, <<EOF)
    -#include <netinet/in.h>
    -EOF
  • elsif macro_defined?(“KAME”, “#include <netinet/in.h>”)
    $ipv6type = “kame”
    $ipv6lib=“inet6”
    @@ -64,21 +61,15 @@ EOF
    $ipv6libdir=“/usr/inet6/lib”
    $CFLAGS="-DINET6 -I/usr/inet6/include "+$CFLAGS
  • elsif macro_defined?(“_TOSHIBA_INET6”, <<EOF)
    -#include <sys/param.h>
    -EOF
  • elsif macro_defined?(“_TOSHIBA_INET6”, “#include <sys/param.h>”)
    $ipv6type = “toshiba”
    $ipv6lib=“inet6”
    $ipv6libdir=“/usr/local/v6/lib”
    $CFLAGS="-DINET6 "+$CFLAGS
  • elsif macro_defined?(“V6D”, <<EOF)
    -#include </usr/local/v6/include/sys/v6config.h>
    -EOF
  • elsif macro_defined?(“V6D”, “#include </usr/local/v6/include/sys/v6config.h>”)
    $ipv6type = “v6d”
    $ipv6lib=“v6”
    $ipv6libdir=“/usr/local/v6/lib”
    $CFLAGS="-DINET6 -I/usr/local/v6/include "+$CFLAGS
  • elsif macro_defined?(“_ZETA_MINAMI_INET6”, <<EOF)
    -#include <sys/param.h>
    -EOF
  • elsif macro_defined?(“_ZETA_MINAMI_INET6”, “#include <sys/param.h>”)
    $ipv6type = “zeta”
    $ipv6lib=“inet6”
    @@ -90,5 +81,6 @@ EOF
    $CFLAGS="-DINET6 "+$CFLAGS
    end
  • $ipv6type}
  • if $ipv6lib
    if File.directory? $ipv6libdir and File.exist? “#{$ipv6libdir}/lib#{$ipv6lib}.a”
    @@ -106,88 +98,32 @@ EOS
    end
  • if try_link(<<EOF)
    -#ifdef _WIN32
    -# include <windows.h>
    -# include <winsock.h>
    -#else
    -# include <sys/types.h>
    -# include <netdb.h>
    -# include <string.h>
    -# include <sys/socket.h>
    -# include <netinet/in.h>
    -#endif
    -int
    -main()
    -{
  • struct sockaddr_in sin;
  • sin.sin_len;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-DHAVE_SIN_LEN "+$CFLAGS
    +unless $mswin or $bccwin or $mingw
  • headers = %w<sys/types.h netdb.h string.h sys/socket.h netinet/in.h>
    +end
    +if /solaris/ =~ RUBY_PLATFORM and !try_compile(“”)
  • bug of gcc 3.0 on Solaris 8

  • headers << “sys/feature_tests.h”
    end
  • if try_link(<<EOF)
    -#ifdef _WIN32
    -# include <windows.h>
    -# include <winsock.h>
    -#else
    -# include <sys/types.h>
    -# include <netdb.h>
    -# include <string.h>
    -# include <sys/socket.h>
    -#endif
    -int
    -main()
    -{
  • struct sockaddr_storage ss;
  • ss.ss_family;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-DHAVE_SOCKADDR_STORAGE “+$CFLAGS
    -else # doug’s fix, NOW add -Dss_family… only if required!
    -$CPPFLAGS += " -Dss_family=__ss_family -Dss_len=__ss_len”
  • if try_link(<<EOF)
    -#ifdef _WIN32
    -# include <windows.h>
    -# include <winsock.h>
    -#else
    -# include <sys/types.h>
    -# include <netdb.h>
    -# include <string.h>
    -# include <sys/socket.h>
    -#endif
    -int
    -main()
    -{
  • struct sockaddr_storage ss;
  • ss.ss_family;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-DHAVE_SOCKADDR_STORAGE "+$CFLAGS
    +if have_struct_member(“struct sockaddr_in”, “sin_len”, headers)
  • $defs[-1] = “-DHAVE_SIN_LEN”
    end

+flags = " -Dss_family=__ss_family -Dss_len=__ss_len"
+begin

  • if have_struct_member(“struct sockaddr_storage”, “ss_family”, headers)
  • $defs[-1] = “-DHAVE_SOCKADDR_STORAGE”
  • elsif flags # doug’s fix, NOW add -Dss_family… only if required!
  • $CPPFLAGS += flags
  • retry
  • end
    end
  • if try_link(<<EOF)
    -#include <sys/types.h>
    -#include <netdb.h>
    -#include <string.h>
    -#include <sys/socket.h>
    -#include <netinet/in.h>
    -int
    -main()
    -{
  • struct sockaddr sa;
    +if have_struct_member(“struct sockaddr”, “sa_len”, headers)
  • $defs[-1] = "-DHAVE_SA_LEN "+$CFLAGS
    +end
  • sa.sa_len;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-DHAVE_SA_LEN "+$CFLAGS
    +unless have_type(“socklen_t”, headers)
  • $defs[-1] = “-Dsocklen_t=int”
    end

@@ -201,10 +137,6 @@ end

$getaddr_info_ok = false
-if !enable_config(“wide-getaddrinfo”, false) and try_run(<<EOF)
-#include <sys/types.h>
-#include <netdb.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
+if !enable_config(“wide-getaddrinfo”, false) and checking_for(“getaddrinfo”) {try_run(<<EOF)}
+#{cpp_include(headers)}

#ifndef AF_LOCAL
@@ -336,20 +268,4 @@ else
have_header(“arpa/nameser.h”)
have_header(“resolv.h”)
-end

-if !try_link(<<EOF)
-#include <sys/types.h>
-#include <netdb.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-int
-main()
-{

  • socklen_t len;
  • return 0;
    -}
    -EOF
  • $CFLAGS="-Dsocklen_t=int "+$CFLAGS
    end


Nobu Nakada

======= End of Original Message =======<

What is strange is that you don’t have the flag -DHAVE_SOCKADDR_STORAGE
this explain the error messages.

Have you build ruby from a fresh source (i.e. the direct result of `tar
zxf’) ?

Yeah. I downloaded 1.8.0 from ruby-lang.org and did ./configure ; make

-Kurt

···

Guy Decoux

======= End of Original Message =======<

Yeah. I downloaded 1.8.0 from ruby-lang.org and did ./configure ; make

Can you post the file

  ruby-1.8.0/ext/socket/mkmf.log

Guy Decoux

Here it is.

mkmf.log (14.3 KB)

···

On Mon, Sep 01, 2003 at 01:35:18AM +0900, ts wrote:

Yeah. I downloaded 1.8.0 from ruby-lang.org and did ./configure ; make

Can you post the file

ruby-1.8.0/ext/socket/mkmf.log

Guy Decoux

======= End of Original Message =======<

In file included from /usr/include/netinet/in.h:41,
                 from /usr/include/sys/socket.h:203,
                 from conftest.c:2:
/usr/include/sys/stream.h:307: parse error before "projid_t"

I don't understand, in [ruby-talk:80672] you were saying

It turns out that the thing I sent before was from a Solaris 9 machine,
but apparently I need to compile it on a Solaris 8 machine. When I went
to the Solaris 8 machine and looked in that header file, there wasn't

                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

even a projid_t in the file, which makes me think it was different

   ^^^^^^^^^^^^^^^^^^^^^^^^^^^

headers. However, I still get this error message when I try to compile
under Solaris 8:

There is, or not, projid_t in /usr/include/sys/stream.h ?

gcc was build on this station ?

Guy Decoux

I went looking in /usr/include/sys/stream.h and there is no projid_t.

I’m going to make clean and ./configure again, and I’ll send you the
next mkmf.log and maybe it will be different. Oi, this is so confusing
with all the different OSes.

-Kurt

···

On Mon, Sep 01, 2003 at 01:57:10AM +0900, ts wrote:

In file included from /usr/include/netinet/in.h:41,
from /usr/include/sys/socket.h:203,
from conftest.c:2:
/usr/include/sys/stream.h:307: parse error before “projid_t”

I don’t understand, in [ruby-talk:80672] you were saying

It turns out that the thing I sent before was from a Solaris 9 machine,
but apparently I need to compile it on a Solaris 8 machine. When I went
to the Solaris 8 machine and looked in that header file, there wasn’t
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
even a projid_t in the file, which makes me think it was different
^^^^^^^^^^^^^^^^^^^^^^^^^^^
headers. However, I still get this error message when I try to compile
under Solaris 8:

There is, or not, projid_t in /usr/include/sys/stream.h ?

gcc was build on this station ?

Guy Decoux

======= End of Original Message =======<