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

John Dickinson jad at sinodun.com
Thu Dec 12 13:49:04 UTC 2013


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
-------------- 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/22d9d9a3/attachment.bin>


More information about the Opendnssec-develop mailing list