Page MenuHome GnuPG

libassuan: assuan-domain-connect.c needs sys/socket.h and _XPG4_2
Closed, ResolvedPublic

Description

Release: 0.6.9

Environment

sparc-sun-solaris2.9
Compiler: Sun Studio 10

Description

assuan-domain-connect.c fails to compile because sys/socket.h is not included, which defines struct msghdr. Several struct members (msg_control, msg_controllen, msg_flags) are also only defined when _XPG4_2 or _KERNEL is #defined.

How To Repeat

Compile on Solaris.

Fix

Check for Solaris during configure and #define _XPG4_2 and #include <sys/socket.h> as neccessary.

Event Timeline

Hi Ray,

can you try to add the below lines to configure.ac and rerun autogen.sh, configure, make?

To self: BSD probably doesn't like the _XOPEN_* macros to be defined, although it shouldn't really pick on that. So this must be limited to solaris.

case $host in

*-*-solaris* )
   AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
   AC_DEFINE(_XOPEN_SOURCE,          2, Needed to get declarations for msg_control and msg_controllen on Solaris)
   AC_DEFINE(__EXTENSIONS__,         1, Needed to get declarations for msg_control and msg_controllen on Solaris)
   ;;

esac

Ray, Marcus:

any progress on this?

From: Ray Link <rlink+@pitt.edu>
To: bug-any@bugs.gnupg.org
Cc: marcus@g10code.com, gnats-admin@trithemius.gnupg.org
Subject: Re: gnupg/469
Date: Mon, 20 Jun 2005 15:03:11 -0400 (EDT)

On Mon, 20 Jun 2005 marcus@g10code.com wrote:

Hi Ray,

can you try to add the below lines to configure.ac and rerun autogen.sh,
configure, make?

I had to check out the CVS version to get the m4/ directory for running
autogen.sh. I added the lines to the following section:


  1. Options depending on the host OS. #

have_dosish_system=no
have_w32_system=no
case "${host}" in

*-mingw32*)
    have_dosish_system=yes
    have_w32_system=yes
    ;;
*-*-solaris* )
    AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
    AC_DEFINE(_XOPEN_SOURCE,          2, Needed to get declarations for msg_control and msg_controllen on Solaris)
    AC_DEFINE(__EXTENSIONS__,         1, Needed to get declarations for msg_control and msg_controllen on Solaris)
    ;;

esac

Unfortunately, I end up with the following in my config.h
and compilation still fails:


/* Needed to get declarations for msg_control and msg_controllen on Solaris */
/* #undef _XOPEN_SOURCE */

/* Needed to get declarations for msg_control and msg_controllen on Solaris */
/* #undef _XOPEN_SOURCE_EXTENDED */

/* Needed to get declarations for msg_control and msg_controllen on Solaris */

/* #undef EXTENSIONS */

I get the same result when I add the check on its own as such:


case "${host}" in

*-mingw32*)
    have_dosish_system=yes
    have_w32_system=yes
    ;;

esac

case $host in

*-*-solaris* )
   AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
   AC_DEFINE(_XOPEN_SOURCE,          2, Needed to get declarations for msg_control and msg_controllen on Solaris)
   AC_DEFINE(__EXTENSIONS__,         1, Needed to get declarations for msg_control and msg_controllen on Solaris)
   ;;

esac

Or did I do something wrong?

Ray Link === University of Pittsburgh CSSD === rlink@pitt.edu
==== PGP/GPG Key:  http://www.pitt.edu/~rlink/gpgkey.asc.txt ====

Sugar makes the world go 'round. Caffeine makes it spin faster.

From: Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
To: Ray Link <rlink+@pitt.edu>
Cc: bug-any@bugs.gnupg.org, gnats-admin@trithemius.gnupg.org
Subject: Re: gnupg/469
Date: Tue, 21 Jun 2005 01:27:19 +0200

At Mon, 20 Jun 2005 15:03:11 -0400 (EDT),
Ray Link <rlink+@pitt.edu> wrote:

I had to check out the CVS version to get the m4/ directory for running
autogen.sh.

Ah, yes, true.

case "${host}" in

*-mingw32*)
    have_dosish_system=yes
    have_w32_system=yes
    ;;
*-*-solaris* )

Unfortunately, I end up with the following in my config.h

I wonder what ${host} looks like on your system. Can you send me the
config.log file, or just search it for ac_cv_host?

Thanks,
Marcus

From: Ray Link <rlink+@pitt.edu>
To: Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Cc: bug-any@bugs.gnupg.org, gnats-admin@trithemius.gnupg.org
Subject: Re: gnupg/469
Date: Tue, 21 Jun 2005 11:33:14 -0400 (EDT)

On Tue, 21 Jun 2005, Marcus Brinkmann wrote:

I wonder what ${host} looks like on your system. Can you send me the
config.log file, or just search it for ac_cv_host?

No results. The ac_cv_host variable never gets created/set. It doesn't
show up when I run configure on a Linux box, either. Does this configure
script actually check for host type? (Sorry, I'm an autoconf rookie.)

Ray Link === University of Pittsburgh CSSD === rlink@pitt.edu
==== PGP/GPG Key:  http://www.pitt.edu/~rlink/gpgkey.asc.txt ====

For some reason I was confusing "SubGenius" with "GNU" there.

  • The Cube, Forum 3000

From: Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
To: Ray Link <rlink+@pitt.edu>
Cc: bug-any@bugs.gnupg.org, gnats-admin@trithemius.gnupg.org
Subject: Re: gnupg/469
Date: Tue, 21 Jun 2005 23:28:35 +0200

At Tue, 21 Jun 2005 11:33:14 -0400 (EDT),
Ray Link <rlink+@pitt.edu> wrote:

On Tue, 21 Jun 2005, Marcus Brinkmann wrote:

I wonder what ${host} looks like on your system. Can you send me the
config.log file, or just search it for ac_cv_host?

No results. The ac_cv_host variable never gets created/set. It doesn't
show up when I run configure on a Linux box, either. Does this configure
script actually check for host type? (Sorry, I'm an autoconf rookie.)

Argh. Better send me the whole config.log file.

Or what also would work is if you could provide me with a temporary
test account on the machine, or one of a similar type.

Thanks,
Marcus

Fixed in SVN, will be in 0.6.11. Thanks!