summaryrefslogtreecommitdiff
path: root/irc/bitlbee/files/patch-configure
blob: ec294a4764fb7a3cdb1daf0d8f51dc5b653f3974 (plain) (blame)
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
--- configure.orig	2010-10-22 00:51:31.000000000 +0000
+++ configure	2010-11-14 14:17:19.000000000 +0000
@@ -319,6 +319,11 @@ EOF
 }
 
 RESOLV_TESTCODE='
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <netinet/in.h>
+#endif
+
 #include <arpa/nameser.h>
 #include <resolv.h> 
 
@@ -329,13 +334,18 @@ int main()
 }
 '
 
+LIBRESOLV=-lresolv
+
+# In FreeBSD res_* routines are present in libc.so
+[ "$arch" = FreeBSD ] && LIBRESOLV=
+
 detect_resolv_dynamic()
 {
 	TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
 	ret=1
-	echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -lresolv >/dev/null 2>/dev/null
+	echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null
 	if [ "$?" = "0" ]; then
-		echo 'EFLAGS+=-lresolv' >> Makefile.settings
+		echo "EFLAGS+=$LIBRESOLV" >> Makefile.settings
 		ret=0
 	fi