summaryrefslogtreecommitdiff
path: root/packages/ettercap/ettercap-0.6.b/configure.patch
blob: 89132125b8293259a0161fd21b0ed7f5f826e717 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
--- tmp/base/ettercap-0.6.b-r0/ettercap-0.6.b/acinclude.m4	Thu Jul 10 03:25:31 2003
+++ ettercap-0.6.b/acinclude.m4	Thu Nov  6 18:25:39 2003
@@ -182,9 +182,11 @@
 dnl     HAVE_SOCKLEN_T
 dnl
 
-AC_DEFUN(EC_SOCKLEN_CHECK,
-   [AC_MSG_CHECKING(for socklen_t in sys/socket.h)
+samba_cv_socklen_t
 
+AC_DEFUN(EC_SOCKLEN_CHECK,
+   [AC_CACHE_CHECK([for socklen_t in sys/socket.h],
+		   [ettercap_cv_type_socklen_t],
    AC_TRY_RUN([
       #include <sys/types.h>
       #include <sys/socket.h>
@@ -197,14 +199,12 @@
          return 0;
       }
    ],
-   [  AC_MSG_RESULT(yes)
-      AC_DEFINE(HAVE_SOCKLEN_T)
-      ],
-      AC_MSG_RESULT(no);
-      ,
-      AC_MSG_RESULT(unkown when cross-compiling)
-   )
+   [ettercap_cv_type_socklen_t=yes],
+   [ettercap_cv_type_socklen_t=no]))
 
+   if test X$ettercap_cv_type_socklen_t = Xyes; then
+     AC_DEFINE(HAVE_SOCKLEN_T)
+   fi
 ])
 
 
@@ -377,24 +377,78 @@
 
 AC_DEFUN(EC_NS_GET,[
 
-   AC_MSG_CHECKING(for NS_GET32)
-   AC_TRY_RUN([
-      #include <arpa/nameser.h>
+AC_CACHE_CHECK([for NS_GET32],
+		ec_cv_func_ns_get32,
+		[AC_TRY_LINK([
+		 #include <arpa/nameser.h>
+		 ],
+		 [
+                  int i;
+                  char *p = "\x01\x02\x03\x04";
+                  NS_GET32(i, p);
+		 ],
+		 ec_cv_func_ns_get32=yes,
+		 ec_cv_func_ns_get32=no)
+   if test X$ec_cv_func_ns_get32 = Xyes; then
+     AC_DEFINE(HAVE_NS_GET,1)
+   fi])
+])
 
-      int main()
-      {
-         int i;
-         char *p = "\x01\x02\x03\x04";
-         NS_GET32(i, p);
+dnl vim:ts=3:expandtab
 
-         return 0;
-      }
-   ],
-   [  AC_MSG_RESULT(yes)
-      AC_DEFINE(HAVE_NS_GET,1) ],
-   [  AC_MSG_RESULT(no); ]
-   )
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN(PKG_CHECK_MODULES, [
+  succeeded=no
+
+  if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+
+  if test "$PKG_CONFIG" = "no" ; then
+     echo "*** The pkg-config script could not be found. Make sure it is"
+     echo "*** in your path, or set the PKG_CONFIG environment variable"
+     echo "*** to the full path to pkg-config."
+     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+  else
+     PKG_CONFIG_MIN_VERSION=0.9.0
+     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+        AC_MSG_CHECKING(for $2)
+
+        if $PKG_CONFIG --exists "$2" ; then
+            AC_MSG_RESULT(yes)
+            succeeded=yes
+
+            AC_MSG_CHECKING($1_CFLAGS)
+            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+            AC_MSG_RESULT($$1_CFLAGS)
+
+            AC_MSG_CHECKING($1_LIBS)
+            $1_LIBS=`$PKG_CONFIG --libs "$2"`
+            AC_MSG_RESULT($$1_LIBS)
+        else
+            $1_CFLAGS=""
+            $1_LIBS=""
+            ## If we have a custom action on failure, don't print errors, but 
+            ## do set a variable so people can do so.
+            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+            ifelse([$4], ,echo $$1_PKG_ERRORS,)
+        fi
+
+        AC_SUBST($1_CFLAGS)
+        AC_SUBST($1_LIBS)
+     else
+        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+        echo "*** See http://www.freedesktop.org/software/pkgconfig"
+     fi
+  fi
 
+  if test $succeeded = yes; then
+     ifelse([$3], , :, [$3])
+  else
+     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+  fi
 ])
 
-dnl vim:ts=3:expandtab
+
--- tmp/base/ettercap-0.6.b-r0/ettercap-0.6.b/configure.in	Thu Jul 10 03:25:31 2003
+++ ettercap-0.6.b/configure.in	Thu Nov  6 18:13:44 2003
@@ -20,9 +20,10 @@
 dnl    $Id: configure.in,v 1.69 2003/06/30 19:57:41 alor Exp $
 dnl
 
-AC_PREREQ([2.50])
+AC_PREREQ(2.57)
 
-AC_INIT(src/ec_main.c)
+AC_INIT
+AC_CONFIG_SRCDIR([src/ec_main.c])
 AC_CONFIG_HEADER(config.h)
 
 echo "char configure_line[[]] = \"$0 $*\";" > ./src/include/ec_debug_info.h
@@ -77,7 +78,7 @@
 dnl   Check the OS
 dnl ================
 
-AC_CANONICAL_SYSTEM
+AC_CANONICAL_TARGET([])
 case "$target_os" in
 *linux*)
    EC_LINUX_KERNEL()
@@ -868,7 +869,8 @@
 
 AC_SUBST(MAKEPLUG)
 
-AC_OUTPUT(ettercap.spec ettercap.8 Makefile $makeplug win32/ettercap.nsi)
+AC_CONFIG_FILES([ettercap.spec ettercap.8 Makefile $makeplug win32/ettercap.nsi])
+AC_OUTPUT
 
 dnl ============================
 dnl   FOR DEBUGING INFORMATIONS