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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
--- a/unix/configure
+++ b/unix/configure
@@ -382,7 +382,7 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
for func in fchmod fchown lchown nl_langinfo
do
echo Check for $func
- echo "int main(){ $func(); return 0; }" > conftest.c
+ echo "void $func(); int main(){ $func(); return 0; }" > conftest.c
$CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`"
done
@@ -401,14 +401,18 @@ ln -s "${temp_link}" "${temp_file}" && \
rm -f "${temp_file}"
echo Check for memset
-echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c
+cat > conftest.c << _EOF_
+#include <string.h>
+int main(){ char k; memset(&k,0,0); return 0; }
+_EOF_
+
$CC -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DZMEM"
echo Check for errno declaration
cat > conftest.c << _EOF_
#include <errno.h>
-main()
+int main()
{
errno = 0;
return 0;
@@ -419,6 +423,8 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
echo Check for directory libraries
cat > conftest.c << _EOF_
+#include <sys/types.h>
+#include <dirent.h>
int main() { return closedir(opendir(".")); }
_EOF_
@@ -439,7 +445,11 @@ fi
# Dynix/ptx 1.3 needed this
echo Check for readlink
-echo "int main(){ return readlink(); }" > conftest.c
+cat > conftest.c << _EOF_
+#include <unistd.h>
+int main(){ return readlink(); }
+_EOF_
+
$CC -o conftest conftest.c >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
$CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null
@@ -523,7 +533,8 @@ fi
# needed for AIX (and others ?) when mmap is used
echo Check for valloc
cat > conftest.c << _EOF_
-main()
+#include <stdlib.h>
+int main()
{
#ifdef MMAP
valloc();
|