diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-11-05 21:15:29 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-11-05 21:15:29 -0700 |
commit | c5de7d4df4ccd7d70a511ee45e1aa901d51efb6f (patch) | |
tree | efb8985dcd1b40866f9f67ce945898015ae08029 /configure | |
parent | a5f2b7e6641a5f7ebaf01dd0e9fa10200ceb4606 (diff) | |
download | txr-c5de7d4df4ccd7d70a511ee45e1aa901d51efb6f.tar.gz txr-c5de7d4df4ccd7d70a511ee45e1aa901d51efb6f.tar.bz2 txr-c5de7d4df4ccd7d70a511ee45e1aa901d51efb6f.zip |
Task #11442. Make work on MingW.
* configure: Test for environ and GetEnvironmentStrings.
* lib.c: Conditionally include <windows.h>.
(env): Implemented for POSIX and Windows with #ifdefs.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -870,6 +870,49 @@ else fi # +# environ +# + +printf "Checking whether we have environ ... " + +cat > conftest.c <<! +int main(void) +{ + extern char **environ; + puts(environ[0]); + return 0; +} +! +if ! make conftest > 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 <<! +#include <windows.h> + +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 # |