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`.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
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.";