summaryrefslogtreecommitdiff
path: root/devel/zlib/patches/patch-ac
blob: ce1abdedf96e0f892d89ba55499d226340a793c7 (plain)
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
$NetBSD: patch-ac,v 1.1 2003/03/05 13:05:45 salo Exp $

--- configure.orig	1998-07-08 20:19:35.000000000 +0200
+++ configure	2003-03-05 04:04:33.000000000 +0100
@@ -181,6 +181,32 @@
   echo Checking for mmap support... No.
 fi
 
+cat > $test.c <<EOF
+#include <stdio.h>
+char *p;
+int main() { return snprintf(p, 10, "1234567890"); }
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+  echo "Checking for snprintf... Yes."
+  CFLAGS="$CFLAGS -DHAS_snprintf"
+else
+  echo "Checking for snprintf... No."
+fi
+
+cat > $test.c <<EOF
+#include <stdio.h>
+#include <stdarg.h>
+char *p;
+va_list ap;
+int main() { return vsnprintf(p, 10, "1234567890", ap); }
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+  echo "Checking for vsnprintf... Yes."
+  CFLAGS="$CFLAGS -DHAS_vsnprintf"
+else
+  echo "Checking for vsnprintf... No."
+fi
+
 CPP=${CPP-"$CC -E"}
 case $CFLAGS in
   *ASMV*)
@@ -195,7 +221,7 @@
 rm -f $test.[co] $test$shared_ext
 
 # udpate Makefile
-sed < Makefile.in "
+sed < lt.mk "
 /^CC *=/s%=.*%=$CC%
 /^CFLAGS *=/s%=.*%=$CFLAGS%
 /^CPP *=/s%=.*%=$CPP%