gpgme 1.8 build failure: strdup undeclared on MacOSX Sierra
Closed, ResolvedPublic

Description

Copying this issue from the ML so it doesn't get lost.

Build environment: macOS Sierra, XCode 8.1.

quorra:gpgme-1.8.0 rjh$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in src
make[2]: Nothing to be done for `all'.
Making all in tests
Making all in gpg
make[3]: Nothing to be done for `all'.
Making all in gpgsm
make[3]: Nothing to be done for `all'.
Making all in opassuan
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all-am'.
Making all in doc
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
make[3]: Nothing to be done for `all-am'.
Making all in lang
Making all in cl
make[3]: Nothing to be done for `all'.
Making all in cpp
Making all in src
/bin/sh ../../../libtool --tag=CXX --mode=compile g++ -std=c++11
-DHAVE_CONFIG_H -I. -I../../.. -I../../../src -I/usr/local/include
-I/usr/local/include -DBUILDING_GPGMEPP -g -O2 -MT
keygenerationresult.lo -MD -MP -MF .deps/keygenerationresult.Tpo -c -o
keygenerationresult.lo keygenerationresult.cpp
libtool: compile: g++ -std=c++11 -DHAVE_CONFIG_H -I. -I../../..
-I../../../src -I/usr/local/include -I/usr/local/include
-DBUILDING_GPGMEPP -g -O2 -MT keygenerationresult.lo -MD -MP -MF
.deps/keygenerationresult.Tpo -c keygenerationresult.cpp -fno-common
-DPIC -o .libs/keygenerationresult.o
keygenerationresult.cpp:43:23: error: use of undeclared identifier 'strdup'

res.fpr = strdup(res.fpr);
          ^

1 error generated.

neal set Version to 1.8.0.
neal added subscribers: neal, rjh.
werner added a subscriber: werner.Jan 6 2017, 7:09 PM

We don't see that on our Sierra box.

justus added a subscriber: justus.Jan 16 2017, 11:10 AM

We configure the build with -D_DARWIN_C_SOURCE=900000L on our macOs box. Not
sure if this is the proper thing to do, and/or if we should just always set that
when we build on Darwin in configure.

FWIW: In GnuPG we have for example this in the configure script

*-*-hpux*)
    if test -z "$GCC" ; then
        CFLAGS="-Ae -D_HPUX_SOURCE $CFLAGS"
    fi

IF it makes things easier we may add a simlar case for macOS. But we need to do
this for many packages, I think.

justus claimed this task.Feb 13 2017, 10:33 AM

I addressed this for GPGME in 60273e8b2c11d42215a5707bc55e3e0d8f350e07 but
apparently forgot to mention that here.

I'll keep the bug open until I fixed this in all packages.

justus closed this task as Resolved.Mar 8 2017, 1:33 PM