From c5de7d4df4ccd7d70a511ee45e1aa901d51efb6f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 5 Nov 2011 21:15:29 -0700 Subject: Task #11442. Make work on MingW. * configure: Test for environ and GetEnvironmentStrings. * lib.c: Conditionally include . (env): Implemented for POSIX and Windows with #ifdefs. --- configure | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'configure') diff --git a/configure b/configure index ba37a922..6f98e559 100755 --- a/configure +++ b/configure @@ -869,6 +869,49 @@ else printf "#define HAVE_SYS_WAIT 1\n" >> config.h fi +# +# environ +# + +printf "Checking whether we have environ ... " + +cat > conftest.c < conftest.err 2>&1 || ! [ -x conftest ] ; then + printf "no\n" +else + printf "yes\n" + printf "#define HAVE_ENVIRON 1\n" >> config.h +fi + +# +# GetEnvironmentStrings +# + +printf "Checking whether we have GetEnvironmentStrings ... " + +cat > conftest.c < + +int main(void) +{ + WCHAR *ptr = GetEnvironmentStringsW(); + return 0; +} +! +if ! make conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then + printf "no\n" +else + printf "yes\n" + printf "#define HAVE_GETENVIRONMENTSTRINGS 1\n" >> config.h +fi + # # Clean up # -- cgit v1.2.3