[Opendnssec-develop] building on OS X (SUPPORT-86)

John Dickinson jad at sinodun.com
Thu Dec 12 16:32:49 UTC 2013


It appears that having both

	#  ifndef _XOPEN_SOURCE
	#    define _XOPEN_SOURCE 600
	#  endif
	#  ifndef _POSIX_C_SOURCE
	#    define _POSIX_C_SOURCE 200112
	#  endif

in configure.ac is the problem. Remove this and you don’t need _POSIX_C_SOURCE or _DARWIN_C_SOURCE to build the code.

Just double checked and removing this doesn’t break the build on Ubuntu 13.10. Are these defines needed?

John


On 12 Dec 2013, at 13:49, John Dickinson <jad at sinodun.com> wrote:

> Hi,
> 
> This applies to trunk and the 1.4 branch. Seems like things are weird on OS X.
> 
> ./configure CFLAGS=“-D_POSIX_C_SOURCE” works (well it builds at least).
> 
> However editing configure.ac and adding (to the darwin target-specific stuff)
> 
> Index: configure.ac
> ===================================================================
> --- configure.ac	(revision 7426)
> +++ configure.ac	(working copy)
> @@ -133,6 +133,7 @@
> 	    [Define if your platform breaks doing a seteuid before a setuid])
> 	AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken])
> 	AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken])
> +    CFLAGS="-D_DARWIN_C_SOURCE $CFLAGS"
>     ;;
> esac
> 
> requires _DARWIN_C_SOURCE to work. If you use _POSIX_C_SOURCE (or nothing) you get the following build error:
> 
> gcc -DHAVE_CONFIG_H -I. -I../../../common  -I../../../common -I../../../common -I./cryptoki_compat -I/usr/local/include -I/opt/local/include/libxml2  -std=c99 -D_POSIX_C_SOURCE -g -O2 -pedantic -Wall -Wextra -D_THREAD_SAFE -pthread -MT pin.o -MD -MP -MF .deps/pin.Tpo -c -o pin.o pin.c
> pin.c:111:17: error: variable has incomplete type 'union semun'
>    union semun arg;
>                ^
> pin.c:111:11: note: forward declaration of 'union semun'
>    union semun arg;
>          ^
> pin.c:419:17: error: variable has incomplete type 'union semun'
>    union semun arg;
>                ^
> pin.c:419:11: note: forward declaration of 'union semun'
>    union semun arg;
>          ^
> 2 errors generated.
> 
> BTW:
> 
>        #  ifndef _POSIX_C_SOURCE
>        #    define _POSIX_C_SOURCE 200112
>        #  endif
> 
> is in the the AH_BOTTOM clause. Should that be 200112L to be consistent with the _XOPEN_SOURCE 600???
> 
> Any ideas?
> 
> This was tested on Mavericks.
> John
> _______________________________________________
> Opendnssec-develop mailing list
> Opendnssec-develop at lists.opendnssec.org
> https://lists.opendnssec.org/mailman/listinfo/opendnssec-develop

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.opendnssec.org/pipermail/opendnssec-develop/attachments/20131212/7ddc6ea1/attachment.bin>


More information about the Opendnssec-develop mailing list