Hi,
I'm attempting to compile under cygwin.
Calling configure (with --disable-python) succeeds, but make fails (with error message as below).
The problem would appear to be the absence of 'secure_getenv', though FWIW the generated makefile contains 'HAVE_SECURE_GETENV = 0'.
Any pointers on how I might get this to compile (preferably with minimum disruption to the source or build process)?
Thanks and best wishes,
Jerry.
===============================
Error message:
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../buddy/src -I../../lib -I../../lib -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -DSPOT_BUILD -std=c++14 -g -O3 -ffast-math -fstrict-aliasing -fomit-frame-pointer -MT tmpfile.lo -MD -MP -MF .deps/tmpfile.Tpo -c -o tmpfile.lo tmpfile.cc libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../buddy/src -I../../lib -I../../lib -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -DSPOT_BUILD -std=c++14 -g -O3 -ffast-math -fstrict-aliasing -fomit-frame-pointer -MT tmpfile.lo -MD -MP -MF .deps/tmpfile.Tpo -c tmpfile.cc -DDLL_EXPORT -DPIC -o .libs/tmpfile.o tmpfile.cc: In function ‘const char* spot::{anonymous}::get_tmpdir()’: tmpfile.cc:36:25: error: ‘secure_getenv’ was not declared in this scope const char* res = secure_getenv("SPOT_TMPDIR"); ^~~~~~~~~~~~~ tmpfile.cc: In destructor ‘virtual spot::temporary_file::~temporary_file()’: tmpfile.cc:89:32: error: ‘secure_getenv’ was not declared in this scope static bool must_unlink = !secure_getenv("SPOT_TMPKEEP"); [...] make: *** [Makefile:1194: all] Error 2
===============================
Hi Jerry,
On 2018-10-18 12:29, Jerry Swan wrote:
I'm attempting to compile under cygwin.
[...]
The problem would appear to be the absence of 'secure_getenv', though FWIW the generated makefile contains 'HAVE_SECURE_GETENV = 0'.
We supply a replacement implementation of secure_getenv() that should be used on systems where this function is not available. That replacement is defined in lib/stdlib.h, but I see that spot/misc/tmpfile.c includes <cstdlib> instead.
I'd expect <cstdlib> to include <stdlib.h> and the compiler to prefer our version of that header over the standard one, but probably it's the standard one that gets used in your case.
Can you try to edit spot/misc/tmpfile.c and replace <cstdlib> by <stdlib.h> on line 23?
Best regards,
PS: in case it can be of any help, we have statically compiled binaries using MinGW at https://gitlab.lrde.epita.fr/spot/spot/-/jobs/artifacts/stable/browse?job=mi... (Those are built using a cross-compiler and not tested, as we don't have any Windows system around.)