summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-11-05 21:15:29 -0700
committerKaz Kylheku <kaz@kylheku.com>2011-11-05 21:15:29 -0700
commitc5de7d4df4ccd7d70a511ee45e1aa901d51efb6f (patch)
treeefb8985dcd1b40866f9f67ce945898015ae08029 /configure
parenta5f2b7e6641a5f7ebaf01dd0e9fa10200ceb4606 (diff)
downloadtxr-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-xconfigure43
1 files changed, 43 insertions, 0 deletions
diff --git a/configure b/configure
index ba37a922..6f98e559 100755
--- a/configure
+++ b/configure
@@ -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
#