Commit e19bf0763a69fef461adc3f133b82eb41ac954de

Boris Nagaev 2016-07-25T13:49:13

configure: put test.{c,dll} to current directory (#26) instead of /tmp/ to avoid races when building for multiple targets. Add test files to .gitignore and `make clean`.

diff --git a/.gitignore b/.gitignore
index e787664..7c2cf35 100644
--- a/.gitignore
+++ b/.gitignore
@@ -233,3 +233,7 @@ FakesAssemblies/
 
 # Visual Studio 6 workspace options file
 *.opt
+
+# test files produced by ./configure
+tmptest.c
+tmptest.dll
diff --git a/Makefile b/Makefile
index aec9ba8..c02dce0 100644
--- a/Makefile
+++ b/Makefile
@@ -70,7 +70,11 @@ test: $(TARGETS) test.exe testdll.dll
 	$(WINE) test.exe
 
 clean::
-	rm -f dlfcn.o libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.exp test.exe testdll.dll
+	rm -f \
+		dlfcn.o \
+		libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.exp \
+		tmptest.c tmptest.dll \
+		test.exe testdll.dll
 
 distclean: clean
 	rm -f config.mak
diff --git a/configure b/configure
index 91f7d07..78b1e85 100755
--- a/configure
+++ b/configure
@@ -154,13 +154,13 @@ disabled shared && disabled static && {
 }
 
 # simple cc test
-cat > /tmp/test.c << EOF
+cat > tmptest.c << EOF
 #include <windows.h>
 void function(void)
 { LoadLibrary(NULL); }
 EOF
-echo testing compiler: $cc -shared -o /tmp/test.dll /tmp/test.c
-$cc -shared -o /tmp/test.dll /tmp/test.c
+echo testing compiler: $cc -shared -o tmptest.dll tmptest.c
+$cc -shared -o tmptest.dll tmptest.c
 
 test "$?" != 0 && {
     echo "$cc could not create shared file with Windows API functions.";