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…
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:
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’.
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’.
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”
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?
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?
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?
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
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:
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?
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
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()
-{
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
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()
-{
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 ?
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 ?